home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / samba / patches / samba-1.042 / samba-1
Text File  |  1995-12-03  |  163KB  |  5,631 lines

  1. diff -u -r --new-file last-version/docs/SCO.txt samba-1.9.15p5/docs/SCO.txt
  2. --- last-version/docs/SCO.txt    Thu Jul 13 21:46:24 1995
  3. +++ samba-1.9.15p5/docs/SCO.txt    Fri Dec  1 09:59:21 1995
  4. @@ -1,4 +1,4 @@
  5. -There is an annoying TCPIP bug in SCO Unix. This causes orruption when
  6. +There is an annoying TCPIP bug in SCO Unix. This causes corruption when
  7.  transferring files with Samba.
  8.  
  9.  Geza Makay (makayg@math.u-szeged.hu) sends this information:
  10. @@ -9,4 +9,8 @@
  11.  You do not need anything else but the above patch. It installs in seconds,
  12.  and corrected the Excel problem. We also had some other minor problems (not
  13.  only with Samba) that disappeared by installing this patch.
  14. +
  15. +I've also heard that you need net382e (whatever that is!). This was
  16. +reported by Eigil Krogh Sorensen <eks@aar-vki.dk>.
  17. +
  18.  
  19. diff -u -r --new-file last-version/docs/Speed.txt samba-1.9.15p5/docs/Speed.txt
  20. --- last-version/docs/Speed.txt    Wed Nov 22 22:24:44 1995
  21. +++ samba-1.9.15p5/docs/Speed.txt    Sun Dec  3 21:46:18 1995
  22. @@ -113,6 +113,19 @@
  23.  read-write. For many applications that do their own locking this
  24.  doesn't matter, but for some it may.
  25.  
  26. +
  27. +MEMORY USAGE
  28. +------------
  29. +
  30. +The biggest user of memory is the MAXDIR option in local.h. This
  31. +determines how many open directories are cached in memory. If the
  32. +client access lots of large directories and doesn't explicitly close
  33. +then when finished then a large MAXDIR can use a lot of server memory.
  34. +
  35. +The default is 64. In most situations it is safe to reduce it to 16 or
  36. +even less. It must be at least 2 to operate correctly.
  37. +
  38. +
  39.  LOG LEVEL
  40.  ---------
  41.  
  42. diff -u -r --new-file last-version/docs/nmbd.8 samba-1.9.15p5/docs/nmbd.8
  43. --- last-version/docs/nmbd.8    Wed Nov 22 22:26:53 1995
  44. +++ samba-1.9.15p5/docs/nmbd.8    Sun Dec  3 18:50:56 1995
  45. @@ -264,7 +264,7 @@
  46.  
  47.  The log files generated are never removed by the server.
  48.  .RE
  49. -.RE
  50. +.\" .RE
  51.  
  52.  .B -n
  53.  .I netbios name
  54. @@ -324,7 +324,7 @@
  55.  mapping of service name (eg., netbios-ns)  to service port (eg., 137) and
  56.  protocol type (eg., udp). See the section "INSTALLATION" below.
  57.  .RE
  58. -.RE
  59. +.\" .RE
  60.  
  61.  .SH ENVIRONMENT VARIABLES
  62.  Not applicable.
  63. @@ -479,7 +479,8 @@
  64.  This man page written by Karl Auer (Karl.Auer@anu.edu.au)
  65.  
  66.  See
  67. -.B smb.conf(5) for a full list of contributors and details on how to 
  68. +.B smb.conf(5)
  69. +for a full list of contributors and details on how to 
  70.  submit bug reports, comments etc.
  71.  
  72.  
  73. diff -u -r --new-file last-version/docs/nmbd.8.orig samba-1.9.15p5/docs/nmbd.8.orig
  74. --- last-version/docs/nmbd.8.orig    Thu Jan  1 10:00:00 1970
  75. +++ samba-1.9.15p5/docs/nmbd.8.orig    Wed Nov 22 22:26:53 1995
  76. @@ -0,0 +1,488 @@
  77. +.TH NMBD 8 17/1/1995 nmbd nmbd
  78. +.SH NAME
  79. +nmbd \- provide netbios nameserver support to clients
  80. +.SH SYNOPSIS
  81. +.B nmbd
  82. +[
  83. +.B -B
  84. +.I broadcast address
  85. +] [
  86. +.B -I
  87. +.I IP address
  88. +] [
  89. +.B -D
  90. +] [
  91. +.B -C comment string
  92. +] [
  93. +.B -G
  94. +.I group name
  95. +] [
  96. +.B -H
  97. +.I netbios hosts file
  98. +] [
  99. +.B -N
  100. +.I netmask
  101. +] [
  102. +.B -d
  103. +.I debuglevel
  104. +] [
  105. +.B -l
  106. +.I log basename
  107. +]
  108. +.B -n
  109. +.I netbios name
  110. +] [
  111. +.B -p
  112. +.I port number
  113. +]
  114. +
  115. +.SH DESCRIPTION
  116. +This program is part of the Samba suite.
  117. +
  118. +.B nmbd
  119. +is a server that understands and can reply to netbios
  120. +name service requests, like those produced by LanManager
  121. +clients. It also controls browsing.
  122. +
  123. +LanManager clients, when they start up, may wish to locate a LanManager server.
  124. +That is, they wish to know what IP number a specified host is using.
  125. +
  126. +This program simply listens for such requests, and if its own name is specified
  127. +it will respond with the IP number of the host it is running on. "Its own name"
  128. +is by default the name of the host it is running on, but this can be overriden
  129. +with the
  130. +.B -n
  131. +option (see "OPTIONS" below). Using the
  132. +.B -S
  133. +option (see "OPTIONS" below), it can also be instructed to respond with IP 
  134. +information about other hosts, provided they are locatable via the 
  135. +gethostbyname() call, or they are in a netbios hosts file.
  136. +
  137. +Nmbd can also be used as a WINS (Windows Internet Name Server)
  138. +server. It will do this automatically by default. What this basically
  139. +means is that it will respond to all name requests that it receives
  140. +that are not broadcasts, as long as it can resolve the name.
  141. +.SH OPTIONS
  142. +.B -B
  143. +
  144. +.RS 3
  145. +On some systems, the server is unable to determine the broadcast address to
  146. +use for name registration requests. If your system has this difficulty, this 
  147. +parameter may be used to specify an appropriate broadcast address. The 
  148. +address should be given in standard "a.b.c.d" notation.
  149. +
  150. +Only use this parameter if you are sure that the server cannot properly 
  151. +determine the proper broadcast address.
  152. +
  153. +The default broadcast address is determined by the server at run time. If it
  154. +encounters difficulty doing so, it makes a guess based on the local IP
  155. +number.
  156. +.RE
  157. +.B -I
  158. +
  159. +.RS 3
  160. +On some systems, the server is unable to determine the correct IP
  161. +address to use. This allows you to override the default choice.
  162. +.RE
  163. +
  164. +.B -D
  165. +
  166. +.RS 3
  167. +If specified, this parameter causes the server to operate as a daemon. That is,
  168. +it detaches itself and runs in the background, fielding requests on the 
  169. +appropriate port.
  170. +
  171. +By default, the server will NOT operate as a daemon.
  172. +.RE
  173. +
  174. +.B -C comment string
  175. +
  176. +.RS 3
  177. +This allows you to set the "comment string" that is shown next to the
  178. +machine name in browse listings. 
  179. +
  180. +A %v will be replaced with the Samba version number.
  181. +
  182. +A %h will be replaced with the hostname.
  183. +
  184. +It defaults to "Samba %v".
  185. +.RE
  186. +
  187. +.B -G
  188. +
  189. +.RS 3
  190. +This option allows you to specify a netbios group (also known as
  191. +lanmanager domain) that the server should be part of. You may include
  192. +several of these on the command line if you like. Alternatively you
  193. +can use the -H option to load a netbios hosts file containing domain names.
  194. +
  195. +At startup, unless the -R switch has been used, the server will
  196. +attempt to register all group names in the hosts file and on the
  197. +command line (from the -G option).
  198. +
  199. +The server will also respond to queries on this name.
  200. +.RE
  201. +
  202. +.B -H
  203. +
  204. +.RS 3
  205. +It may be useful in some situations to be able to specify a list of
  206. +netbios names for which the server should send a reply if
  207. +queried. This option allows that. The syntax is similar to the
  208. +standard /etc/hosts file format, but has some extensions.
  209. +
  210. +The file contains three columns. Lines beginning with a # are ignored
  211. +as comments. The first column is an IP address, or a hostname. If it
  212. +is a hostname then it is interpreted as the IP address returned by
  213. +gethostbyname() when read. Any IP address of 0.0.0.0 will be
  214. +interpreted as the servers own IP address.
  215. +
  216. +The second column is a netbios name. This is the name that the server
  217. +will respond to. It must be less than 20 characters long.
  218. +
  219. +The third column is optional, and is intended for flags. Currently the
  220. +only flags supported are G, S and M. A G indicates that the name is a
  221. +group (also known as domain) name.
  222. +
  223. +At startup all groups known to the server (either from this file or
  224. +from the -G option) are registered on the network (unless the -R
  225. +option has been selected).
  226. +
  227. +A S or G means that the specified address is a broadcast address of a
  228. +network that you want people to be able to browse you from. Nmbd will
  229. +search for a master browser in that domain and will send host
  230. +announcements to that machine, informing it that the specifed somain
  231. +is available.
  232. +
  233. +A M means that this name is the default netbios name for this
  234. +machine. This has the same affect as specifying the -n option to nmbd.
  235. +
  236. +After startup the server waits for queries, and will answer queries to
  237. +any name known to it. This includes all names in the netbios hosts
  238. +file (if any), it's own name, and any names given with the -G option.
  239. +
  240. +The primary intention of the -H option is to allow a mapping from
  241. +netbios names to internet domain names, and to allow the specification
  242. +of groups that the server should be part of.
  243. +
  244. +.B Example:
  245. +
  246. +        # This is a sample netbios hosts file
  247. +
  248. +        # DO NOT USE THIS FILE AS-IS
  249. +        # YOU MAY INCONVENIENCE THE OWNERS OF THESE IPs
  250. +        # if you want to include a name with a space in it then 
  251. +        # use double quotes.
  252. +
  253. +        # first put ourselves in the group LANGROUP
  254. +        0.0.0.0 LANGROUP G
  255. +
  256. +        # next add a netbios alias for a faraway host
  257. +        arvidsjaur.anu.edu.au ARVIDSJAUR
  258. +
  259. +        # finally put in an IP for a hard to find host
  260. +        130.45.3.213 FREDDY
  261. +
  262. +        # now we want another subnet to be able to browse
  263. +        # us in the workgroup UNIXSERV
  264. +        192.0.2.255  UNIXSERV G
  265. +
  266. +.RE
  267. +
  268. +.B -M
  269. +.I workgroup name
  270. +
  271. +.RS 3
  272. +If this parameter is given, the server will look for a master browser
  273. +for the specified workgroup name, report success or failure, then
  274. +exit. If successful, the IP address of the name located will be
  275. +reported. 
  276. +
  277. +If you use the workgroup name "-" then nmbd will search for a master
  278. +browser for any workgroup by using the name __MSBROWSE__.
  279. +
  280. +This option is meant to be used interactively on the command line, not
  281. +as a daemon or in inetd.
  282. +
  283. +.RE
  284. +.B -N
  285. +
  286. +.RS 3
  287. +On some systems, the server is unable to determine the netmask. If
  288. +your system has this difficulty, this parameter may be used to specify
  289. +an appropriate netmask. The mask should be given in standard
  290. +"a.b.c.d" notation.
  291. +
  292. +Only use this parameter if you are sure that the server cannot properly 
  293. +determine the proper netmask.
  294. +
  295. +The default netmask is determined by the server at run time. If it
  296. +encounters difficulty doing so, it makes a guess based on the local IP
  297. +number.
  298. +.RE
  299. +
  300. +.B -d
  301. +.I debuglevel
  302. +.RS 3
  303. +
  304. +debuglevel is an integer from 0 to 5.
  305. +
  306. +The default value if this parameter is not specified is zero.
  307. +
  308. +The higher this value, the more detail will be logged to the log files about
  309. +the activities of the server. At level 0, only critical errors and serious 
  310. +warnings will be logged. Level 1 is a reasonable level for day to day running
  311. +- it generates a small amount of information about operations carried out.
  312. +
  313. +Levels above 1 will generate considerable amounts of log data, and should 
  314. +only be used when investigating a problem. Levels above 3 are designed for 
  315. +use only by developers and generate HUGE amounts of log data, most of which 
  316. +is extremely cryptic.
  317. +.RE
  318. +
  319. +.B -l
  320. +.I log file
  321. +
  322. +.RS 3
  323. +If specified,
  324. +.I logfile
  325. +specifies a base filename into which operational data from the running server
  326. +will be logged.
  327. +
  328. +The default base name is specified at compile time.
  329. +
  330. +The base name is used to generate actual log file names. For example, if the
  331. +name specified was "log", the following files would be used for log data:
  332. +
  333. +.RS 3
  334. +log.nmb (containing debugging information)
  335. +
  336. +log.nmb.in (containing inbound transaction data)
  337. +
  338. +log.nmb.out (containing outbound transaction data)
  339. +.RE
  340. +
  341. +The log files generated are never removed by the server.
  342. +.RE
  343. +.RE
  344. +
  345. +.B -n
  346. +.I netbios name
  347. +
  348. +.RS 3
  349. +This parameter tells the server what netbios name to respond with when 
  350. +queried. The same name is also registered on startup unless the -R 
  351. +parameter was specified.
  352. +
  353. +The default netbios name used if this parameter is not specified is the 
  354. +name of the host on which the server is running.
  355. +.RE
  356. +
  357. +.B -p
  358. +.I port number
  359. +.RS 3
  360. +
  361. +port number is a positive integer value.
  362. +
  363. +The default value if this parameter is not specified is 137.
  364. +
  365. +This number is the port number that will be used when making connections to
  366. +the server from client software. The standard (well-known) port number for the
  367. +server is 137, hence the default. If you wish to run the server as an ordinary
  368. +user rather than as root, most systems will require you to use a port number
  369. +greater than 1024 - ask your system administrator for help if you are in this
  370. +situation.
  371. +
  372. +Note that the name server uses UDP, not TCP!
  373. +
  374. +This parameter is not normally specified except in the above situation.
  375. +.RE
  376. +.SH FILES
  377. +
  378. +.B /etc/inetd.conf
  379. +
  380. +.RS 3
  381. +If the server is to be run by the inetd meta-daemon, this file must contain
  382. +suitable startup information for the meta-daemon. See the section 
  383. +"INSTALLATION" below.
  384. +.RE
  385. +
  386. +.B /etc/rc.d/rc.inet2
  387. +
  388. +.RS 3
  389. +(or whatever initialisation script your system uses)
  390. +
  391. +If running the server as a daemon at startup, this file will need to contain
  392. +an appropriate startup sequence for the server. See the section "Installation"
  393. +below.
  394. +.RE
  395. +
  396. +.B /etc/services
  397. +
  398. +.RS 3
  399. +If running the server via the meta-daemon inetd, this file must contain a
  400. +mapping of service name (eg., netbios-ns)  to service port (eg., 137) and
  401. +protocol type (eg., udp). See the section "INSTALLATION" below.
  402. +.RE
  403. +.RE
  404. +
  405. +.SH ENVIRONMENT VARIABLES
  406. +Not applicable.
  407. +
  408. +.SH INSTALLATION
  409. +The location of the server and its support files is a matter for individual
  410. +system administrators. The following are thus suggestions only.
  411. +
  412. +It is recommended that the server software be installed under the /usr/local
  413. +hierarchy, in a directory readable by all, writeable only by root. The server
  414. +program itself should be executable by all, as users may wish to run the 
  415. +server themselves (in which case it will of course run with their privileges).
  416. +The server should NOT be setuid or setgid!
  417. +
  418. +The server log files should be put in a directory readable and writable only
  419. +by root, as the log files may contain sensitive information.
  420. +
  421. +The remaining notes will assume the following:
  422. +
  423. +.RS 3
  424. +nmbd (the server program) installed in /usr/local/smb
  425. +
  426. +log files stored in /var/adm/smblogs
  427. +.RE
  428. +
  429. +The server may be run either as a daemon by users or at startup, or it may
  430. +be run from a meta-daemon such as inetd upon request. If run as a daemon, the
  431. +server will always be ready, so starting sessions will be faster. If run from 
  432. +a meta-daemon some memory will be saved and utilities such as the tcpd 
  433. +TCP-wrapper may be used for extra security.
  434. +
  435. +When you've decided, continue with either "Running the server as a daemon" or
  436. +"Running the server on request".
  437. +.SH RUNNING THE SERVER AS A DAEMON
  438. +To run the server as a daemon from the command line, simply put the "-D" option
  439. +on the command line. There is no need to place an ampersand at the end of the
  440. +command line - the "-D" option causes the server to detach itself from the
  441. +tty anyway.
  442. +
  443. +Any user can run the server as a daemon (execute permissions permitting, of 
  444. +course). This is useful for testing purposes.
  445. +
  446. +To ensure that the server is run as a daemon whenever the machine is started,
  447. +you will need to modify the system startup files. Wherever appropriate (for
  448. +example, in /etc/rc.d/rc.inet2), insert the following line, substituting 
  449. +values appropriate to your system:
  450. +
  451. +.RS 3
  452. +/usr/local/smb/nmbd -D -l/var/adm/smblogs/log
  453. +.RE
  454. +
  455. +(The above should appear in your initialisation script as a single line. 
  456. +Depending on your terminal characteristics, it may not appear that way in
  457. +this man page. If the above appears as more than one line, please treat any 
  458. +newlines or indentation as a single space or TAB character.)
  459. +
  460. +If the options used at compile time are appropriate for your system, all
  461. +parameters except the desired debug level and "-D" may be omitted. See the
  462. +section on "Options" above.
  463. +.SH RUNNING THE SERVER ON REQUEST
  464. +If your system uses a meta-daemon such as inetd, you can arrange to have the
  465. +SMB name server started whenever a process attempts to connect to it. This 
  466. +requires several changes to the startup files on the host machine. If you are
  467. +experimenting as an ordinary user rather than as root, you will need the 
  468. +assistance of your system administrator to modify the system files.
  469. +
  470. +First, ensure that a port is configured in the file /etc/services. The 
  471. +well-known port 137 should be used if possible, though any port may be used.
  472. +
  473. +Ensure that a line similar to the following is in /etc/services:
  474. +
  475. +.RS 3
  476. +netbios-ns    137/udp
  477. +.RE
  478. +
  479. +Note for NIS/YP users: You may need to rebuild the NIS service maps rather
  480. +than alter your local /etc/services file.
  481. +
  482. +Next, put a suitable line in the file /etc/inetd.conf (in the unlikely event
  483. +that you are using a meta-daemon other than inetd, you are on your own). Note
  484. +that the first item in this line matches the service name in /etc/services.
  485. +Substitute appropriate values for your system in this line (see
  486. +.B inetd(8)):
  487. +
  488. +.RS 3
  489. +netbios-ns dgram udp wait root /usr/local/smb/nmbd -l/var/adm/smblogs/log
  490. +.RE
  491. +
  492. +(The above should appear in /etc/inetd.conf as a single line. Depending on 
  493. +your terminal characteristics, it may not appear that way in this man page.
  494. +If the above appears as more than one line, please treat any newlines or 
  495. +indentation as a single space or TAB character.)
  496. +
  497. +Note that there is no need to specify a port number here, even if you are 
  498. +using a non-standard port number.
  499. +.SH TESTING THE INSTALLATION
  500. +If running the server as a daemon, execute it before proceeding. If
  501. +using a meta-daemon, either restart the system or kill and restart the 
  502. +meta-daemon. Some versions of inetd will reread their configuration tables if
  503. +they receive a HUP signal.
  504. +
  505. +To test whether the name server is running, start up a client
  506. +.I on a different machine
  507. +and see whether the desired name is now present. Alternatively, run 
  508. +the nameserver
  509. +.I on a different machine
  510. +specifying "-L netbiosname", where "netbiosname" is the name you have 
  511. +configured the test server to respond with. The command should respond 
  512. +with success, and the IP number of the machine using the specified netbios 
  513. +name. You may need the -B parameter on some systems. See the README
  514. +file for more information on testing nmbd.
  515. +
  516. +.SH VERSION
  517. +This man page is (mostly) correct for version 1.9.00 of the Samba suite, plus some
  518. +of the recent patches to it. These notes will necessarily lag behind 
  519. +development of the software, so it is possible that your version of 
  520. +the server has extensions or parameter semantics that differ from or are not 
  521. +covered by this man page. Please notify these to the address below for 
  522. +rectification.
  523. +.SH SEE ALSO
  524. +.B inetd(8),
  525. +.B smbd(8), 
  526. +.B smb.conf(5),
  527. +.B smbclient(1),
  528. +.B testparm(1), 
  529. +.B testprns(1)
  530. +
  531. +.SH DIAGNOSTICS
  532. +[This section under construction]
  533. +
  534. +Most diagnostics issued by the server are logged in the specified log file. The
  535. +log file name is specified at compile time, but may be overridden on the
  536. +command line.
  537. +
  538. +The number and nature of diagnostics available depends on the debug level used
  539. +by the server. If you have problems, set the debug level to 3 and peruse the
  540. +log files.
  541. +
  542. +Most messages are reasonably self-explanatory. Unfortunately, at time of
  543. +creation of this man page the source code is still too fluid to warrant
  544. +describing each and every diagnostic. At this stage your best bet is still
  545. +to grep the source code and inspect the conditions that gave rise to the 
  546. +diagnostics you are seeing.
  547. +
  548. +.SH BUGS
  549. +None known.
  550. +.SH CREDITS
  551. +The original Samba software and related utilities were created by 
  552. +Andrew Tridgell (samba-bugs@anu.edu.au). Andrew is also the Keeper
  553. +of the Source for this project.
  554. +
  555. +This man page written by Karl Auer (Karl.Auer@anu.edu.au)
  556. +
  557. +See
  558. +.B smb.conf(5) for a full list of contributors and details on how to 
  559. +submit bug reports, comments etc.
  560. +
  561. +
  562. +
  563. +
  564. +
  565. diff -u -r --new-file last-version/docs/smb.conf.5 samba-1.9.15p5/docs/smb.conf.5
  566. --- last-version/docs/smb.conf.5    Thu Nov 23 11:03:28 1995
  567. +++ samba-1.9.15p5/docs/smb.conf.5    Sun Dec  3 19:12:21 1995
  568. @@ -320,6 +320,10 @@
  569.  
  570.  auto services
  571.  
  572. +browse list
  573. +
  574. +character set
  575. +
  576.  config file
  577.  
  578.  deadtime
  579. @@ -698,9 +702,30 @@
  580.  .B Example: 
  581.      browseable = No
  582.  
  583. +.SS browse list (G)
  584. +
  585. +This boolean determines if the server will allow the client to query
  586. +the local browse list, which holds the list of available servers in
  587. +the workgroup.
  588. +
  589. +It defaults to yes.
  590. +
  591.  .SS case sig names (G)
  592.  See "case sensitive"
  593.  
  594. +.SS character set (G)
  595. +
  596. +This option allows you to select an alternate character set for the
  597. +server, to allow for correct translation of "foreign" characters.
  598. +
  599. +Currently the only supported alternate character set is "iso8859-1"
  600. +which is probably good for sweden and maybe other nordic countries.
  601. +
  602. +The default is to use the PCs characters untranslated.
  603. +
  604. +.B Example:
  605. +    character set = iso8859-1
  606. +
  607.  .SS comment (S)
  608.  This is a text field that is seen when a client does a net view to
  609.  list what shares are available. It will also be used when browsing is
  610. @@ -1613,7 +1638,8 @@
  611.  .B password level
  612.  is set to 1 (one), the following combinations would be tried if "FRED" failed:
  613.  "Fred", "fred", "fRed", "frEd", "freD". If
  614. -.B password level was set to 2 (two), the following combinations would also be
  615. +.B password level
  616. +was set to 2 (two), the following combinations would also be
  617.  tried: "FRed", "FrEd", "FreD", "fREd", "fReD", "frED". And so on.
  618.  
  619.  The higher value this parameter is set to the more likely it is that a mixed
  620. diff -u -r --new-file last-version/docs/smb.conf.5.orig samba-1.9.15p5/docs/smb.conf.5.orig
  621. --- last-version/docs/smb.conf.5.orig    Wed Nov 22 22:47:24 1995
  622. +++ samba-1.9.15p5/docs/smb.conf.5.orig    Sun Dec  3 00:19:58 1995
  623. @@ -320,6 +320,8 @@
  624.  
  625.  auto services
  626.  
  627. +browse list
  628. +
  629.  config file
  630.  
  631.  deadtime
  632. @@ -414,6 +416,10 @@
  633.  
  634.  strip dot
  635.  
  636. +syslog
  637. +
  638. +syslog only
  639. +
  640.  time offset
  641.  
  642.  username map
  643. @@ -694,6 +700,14 @@
  644.  .B Example: 
  645.      browseable = No
  646.  
  647. +.SS browse list (G)
  648. +
  649. +This boolean determines if the server will allow the client to query
  650. +the local browse list, which holds the list of available servers in
  651. +the workgroup.
  652. +
  653. +It defaults to yes.
  654. +
  655.  .SS case sig names (G)
  656.  See "case sensitive"
  657.  
  658. @@ -2293,6 +2307,43 @@
  659.  
  660.  .B Example:
  661.      sync always = yes
  662. +
  663. +.SS syslog (G)
  664. +
  665. +This integer parameter is used in conjunction with
  666. +.B debug level
  667. +to filter out debugging messages destined for the system logger.
  668. +Only those debugging messages that are
  669. +.I less than or equal to
  670. +.B debug level
  671. +and
  672. +.I less than
  673. +.B syslog
  674. +are sent to the system logger.  Thus, a value of 0 can be used
  675. +to turn off system logging.
  676. +
  677. +You must compile with -DSYSLOG in order for system logging to
  678. +be enabled.
  679. +
  680. +.B Default:
  681. +    syslog = 1
  682. +
  683. +.B Example:
  684. +    syslog = 0
  685. +
  686. +.SS syslog only (G)
  687. +
  688. +This boolean controls whether debugging messages are sent to the
  689. +log file and system logger, or only to the system logger.
  690. +
  691. +You must compile with -DSYSLOG in order for system logging to
  692. +be enabled.
  693. +
  694. +.B Default:
  695. +    syslog only = False
  696. +
  697. +.B Example:
  698. +    syslog only = True
  699.  
  700.  .SS time offset (G)
  701.  This parameter is a setting in minutes to add to the normal GMT to
  702. diff -u -r --new-file last-version/docs/smbclient.1 samba-1.9.15p5/docs/smbclient.1
  703. --- last-version/docs/smbclient.1    Wed Nov 22 22:28:03 1995
  704. +++ samba-1.9.15p5/docs/smbclient.1    Sun Dec  3 18:50:56 1995
  705. @@ -50,7 +50,8 @@
  706.  an interface similar to that of the 
  707.  .B ftp
  708.  program (see
  709. -.B ftp(1)). Operations include things like getting files from the
  710. +.B ftp(1)).
  711. +Operations include things like getting files from the
  712.  server to the local machine, putting files from the local machine to
  713.  the server, retrieving directory information from the server and so on.
  714.  
  715. @@ -316,7 +317,7 @@
  716.  
  717.  The log files generated are never removed by the client.
  718.  .RE
  719. -.RE
  720. +.\" .RE
  721.  
  722.  .B -n
  723.  .I netbios name
  724. @@ -850,7 +851,7 @@
  725.  files that match the mask specified using the
  726.  .B mask
  727.  command will be retrieved. See also the
  728. -.mask
  729. +.B mask
  730.  command.
  731.  
  732.  When recursion is toggled OFF, only files from the current working
  733. @@ -936,7 +937,8 @@
  734.  
  735.  To test the client, you will need to know the name of a running Lan manager
  736.  server. It is possible to run the smbd (see
  737. -.B smbd(8)) as an ordinary user - running that server as a daemon on a
  738. +.B smbd(8))
  739. +as an ordinary user - running that server as a daemon on a
  740.  user-accessible port (typically any port number over 1024) would
  741.  provide a suitable test server.
  742.  .SH VERSION
  743. @@ -976,5 +978,6 @@
  744.  This man page written by Karl Auer (Karl.Auer@anu.edu.au)
  745.  
  746.  See
  747. -.B smb.conf(5) for a full list of contributors and details on how to 
  748. +.B smb.conf(5)
  749. +for a full list of contributors and details on how to 
  750.  submit bug reports, comments etc.
  751. diff -u -r --new-file last-version/docs/smbclient.1.orig samba-1.9.15p5/docs/smbclient.1.orig
  752. --- last-version/docs/smbclient.1.orig    Thu Jan  1 10:00:00 1970
  753. +++ samba-1.9.15p5/docs/smbclient.1.orig    Wed Nov 22 22:28:03 1995
  754. @@ -0,0 +1,980 @@
  755. +.TH SMBCLIENT 1 17/1/1995 smbclient smbclient
  756. +.SH NAME
  757. +smbclient \- ftp-like Lan Manager client program
  758. +.SH SYNOPSIS
  759. +.B smbclient
  760. +.B servicename
  761. +[
  762. +.B password
  763. +] [
  764. +.B -A
  765. +] [
  766. +.B -E
  767. +] [
  768. +.B -L
  769. +.I host
  770. +] [
  771. +.B -M
  772. +.I host
  773. +] [
  774. +.B -I
  775. +.I IP number
  776. +] [
  777. +.B -N
  778. +] [
  779. +.B -P
  780. +] [
  781. +.B -U
  782. +.I username
  783. +] [
  784. +.B -d
  785. +.I debuglevel
  786. +] [
  787. +.B -l
  788. +.I log basename
  789. +] [
  790. +.B -n
  791. +.I netbios name
  792. +] [
  793. +.B -O
  794. +.I socket options
  795. +] [
  796. +.B -p
  797. +.I port number
  798. +]
  799. +.SH DESCRIPTION
  800. +This program is part of the Samba suite.
  801. +
  802. +.B smbclient
  803. +is a client that can 'talk' to a Lan Manager server. It offers
  804. +an interface similar to that of the 
  805. +.B ftp
  806. +program (see
  807. +.B ftp(1)). Operations include things like getting files from the
  808. +server to the local machine, putting files from the local machine to
  809. +the server, retrieving directory information from the server and so on.
  810. +
  811. +NOTE: Ricky Poulten (poultenr@logica.co.uk) has written a "tar"
  812. +extension to smbclient that allows you to back up and restore your
  813. +lan-manager compatible network using smbclient.
  814. +
  815. +You can fetch the tar extension from the "contributed" section on
  816. +nimbus. ftp://nimbus.anu.edu.au/pub/tridge/samba/contributed/
  817. +
  818. +
  819. +.SH OPTIONS
  820. +.B servicename
  821. +.RS 3
  822. +.B servicename
  823. +is the name of the service you want to use on the server. A service
  824. +name takes the form
  825. +.B "\\\\\\\\server\\\\service"
  826. +where
  827. +.B server
  828. +is the netbios name of the Lan Manager server offering the desired service and
  829. +.B service
  830. +is the name of the service offered. Thus to connect to the service "printer" 
  831. +on the Lan Manager server "lanman", you would use the servicename
  832. +
  833. +.RS 10
  834. +.B "\\\\\\\\lanman\\\\printer"
  835. +.RE
  836. +
  837. +Note that the server name required is NOT necessarily the host name of the
  838. +server! The name required is a Lan Manager server name, which may or may not
  839. +be the same as the hostname of the machine running the server.
  840. +.RE
  841. +
  842. +.B password
  843. +.RS 3
  844. +.B
  845. +password
  846. +is the password required to access the specified service on the
  847. +specified server. If supplied, the
  848. +.B -N
  849. +option (suppress password prompt) is assumed.
  850. +
  851. +There is no default password. If no password is supplied on the command line
  852. +(either here or using the 
  853. +.B -U
  854. +option (see below)) and 
  855. +.B -N
  856. +is not specified, the client will prompt for a password, even if the desired 
  857. +service does not require one. (If prompted for a password and none is 
  858. +required, simply press ENTER to provide a null password.)
  859. +
  860. +Note: Some servers (including OS/2 and Windows for Workgroups) insist
  861. +on an uppercase password. Lowercase or mixed case passwords may be
  862. +rejected by these servers.
  863. +
  864. +Be cautious about including passwords in scripts.
  865. +.RE
  866. +
  867. +.B -A
  868. +
  869. +.RS 3
  870. +This parameter, if specified, causes the maximum debug level to be selected.
  871. +Be warned that this generates prodigious amounts of debug data. There is also
  872. +a security issue involved, as at the maximum debug level cleartext passwords
  873. +may be written to some log files.
  874. +.RE
  875. +
  876. +.B -L
  877. +
  878. +.RS 3
  879. +This option allows you to look at what services are available on a
  880. +server. You use it as "smbclient -L host" and a list should appear.
  881. +The -I option may be useful if your netbios names don't match your 
  882. +tcp/ip host names or if you are trying to reach a host on another
  883. +network. For example:
  884. +
  885. +smbclient -L ftp -I ftp.microsoft.com
  886. +
  887. +will list the shares available on microsofts public server.
  888. +.RE
  889. +
  890. +.B -M
  891. +
  892. +.RS 3
  893. +This options allows you to send messages, using the "WinPopup"
  894. +protocol, to another computer. Once a connection is established you
  895. +then type your message, pressing ^D (control-D) to end.
  896. +
  897. +If the receiving computer is running WinPopup the user will receive
  898. +the message and probably a beep. If they are not running WinPopup the
  899. +message will be lost, and no error message will occur.
  900. +
  901. +The message is also automatically truncated if the message is over
  902. +1600 bytes, as this is the limit of the protocol.
  903. +
  904. +One useful trick is to cat the message through smbclient. For example:
  905. +
  906. +cat mymessage.txt | smbclient -M FRED
  907. +
  908. +will send the message in the file "mymessage.txt" to the machine FRED.
  909. +
  910. +You may also find the -U and -I options useful, as they allow you to
  911. +control the FROM and TO parts of the message. 
  912. +
  913. +Samba currently has no way of receiving WinPopup messages.
  914. +
  915. +Note: Copy WinPopup into the startup group on your WfWg PCs if you
  916. +want them to always be able to receive messages.
  917. +.RE
  918. +
  919. +.B -E
  920. +
  921. +.RS 3
  922. +This parameter, if specified, causes the client to write messages to the
  923. +standard error stream (stderr) rather than to the standard output stream.
  924. +
  925. +By default, the client writes messages to standard output - typically the
  926. +user's tty.
  927. +.RE
  928. +
  929. +.B -I
  930. +.I IP number
  931. +
  932. +.RS 3
  933. +.I IP number
  934. +represents the IP number of the server to connect to. It should
  935. +be specified in standard "a.b.c.d" notation.
  936. +
  937. +Normally the client will attempt to locate the specified Lan Manager server
  938. +by looking it up - that is, broadcasting a request for the given server to
  939. +identify itself. Using this parameter will force the client to assume that
  940. +the server is on the machine with the specified IP number.
  941. +
  942. +There is no default for this parameter. If not supplied, it will be determined
  943. +automatically by the client as described above.
  944. +.RE
  945. +
  946. +.B -N
  947. +
  948. +.RS 3
  949. +If specified, this parameter suppresses the normal password prompt from the
  950. +client to the user. This is useful when accessing a service that does not
  951. +require a password.
  952. +
  953. +Unless a password is specified on the command line or this parameter is
  954. +specified, the client will request a password.
  955. +.RE
  956. +
  957. +.B -O
  958. +.I socket options
  959. +.RS 3
  960. +
  961. +See the socket options section of smb.conf(5) for details
  962. +
  963. +.RE
  964. +.B -P
  965. +
  966. +.RS 3
  967. +If specified, the service requested will be connected to as a printer service
  968. +rather than as a normal filespace service. Operations such as put and get
  969. +will not be applicable for such a connection.
  970. +
  971. +By default, services will be connected to as NON-printer services.
  972. +.RE
  973. +
  974. +.B -U
  975. +.I username
  976. +
  977. +.RS 3
  978. +.I username
  979. +is the user name that will be used by the client to make a connection,
  980. +assuming your server is running a protocol that allows for usernames.
  981. +
  982. +Some servers are fussy about the case of this name, and some insist
  983. +that it must be a valid netbios name.
  984. +
  985. +If no 
  986. +.I username
  987. +is supplied, it will default to an uppercase version of the 
  988. +environment variable 
  989. +.B USER
  990. +or
  991. +.B LOGNAME
  992. +in that order.
  993. +If no 
  994. +.I username
  995. +is supplied and neither environment variable exists the user name will
  996. +be empty.
  997. +
  998. +If the service you are connecting to requires a password, it can be supplied
  999. +using the
  1000. +.B -U
  1001. +option, by appending a percent symbol ("%") then the password to 
  1002. +.I username.
  1003. +For example, to attach to a service as user "fred" with password "secret", you
  1004. +would specify
  1005. +.B -U
  1006. +.I fred%secret
  1007. +on the command line. Note that there are no spaces around the percent symbol.
  1008. +
  1009. +If you specify the password as part of
  1010. +.I username
  1011. +then the 
  1012. +.B -N
  1013. +option (suppress password prompt) is assumed.
  1014. +
  1015. +If you specify the password as a parameter AND as part of
  1016. +.I username
  1017. +then the password as part of
  1018. +.I username
  1019. +will take precedence. Putting nothing before or nothing after the percent 
  1020. +symbol will cause an empty username or an empty password to be used,
  1021. +respectively.
  1022. +
  1023. +Note: Some servers (including OS/2 and Windows for Workgroups) insist
  1024. +on an uppercase password. Lowercase or mixed case passwords may be
  1025. +rejected by these servers.
  1026. +
  1027. +Be cautious about including passwords in scripts.
  1028. +.RE
  1029. +
  1030. +.B -d
  1031. +.I debuglevel
  1032. +.RS 3
  1033. +
  1034. +debuglevel is an integer from 0 to 5.
  1035. +
  1036. +The default value if this parameter is not specified is zero.
  1037. +
  1038. +The higher this value, the more detail will be logged to the log files about
  1039. +the activities of the client. At level 0, only critical errors and serious 
  1040. +warnings will be logged. Level 1 is a reasonable level for day to day running
  1041. +- it generates a small amount of information about operations carried out.
  1042. +
  1043. +Levels above 1 will generate considerable amounts of log data, and should 
  1044. +only be used when investigating a problem. Levels above 3 are designed for 
  1045. +use only by developers and generate HUGE amounts of log data, most of which 
  1046. +is extremely cryptic.
  1047. +.RE
  1048. +
  1049. +.B -l
  1050. +.I log basename
  1051. +
  1052. +.RS 3
  1053. +If specified,
  1054. +.I log basename
  1055. +specifies a base filename into which operational data from the running client
  1056. +will be logged.
  1057. +
  1058. +The default base name is specified at compile time.
  1059. +
  1060. +The base name is used to generate actual log file names. For example, if the
  1061. +name specified was "log", the following files would be used for log data:
  1062. +
  1063. +.RS 3
  1064. +log.client.debug (containing debugging information)
  1065. +
  1066. +log.client.in (containing inbound transaction data)
  1067. +
  1068. +log.client.out (containing outbound transaction data)
  1069. +.RE
  1070. +
  1071. +The log files generated are never removed by the client.
  1072. +.RE
  1073. +.RE
  1074. +
  1075. +.B -n
  1076. +.I netbios name
  1077. +
  1078. +.RS 3
  1079. +By default, the client will use the local machine's hostname (in
  1080. +uppercase) as its netbios name. This parameter allows you to override
  1081. +the host name and use whatever netbios name you wish.
  1082. +.RE
  1083. +
  1084. +.B -p
  1085. +.I port number
  1086. +.RS 3
  1087. +
  1088. +port number is a positive integer value.
  1089. +
  1090. +The default value if this parameter is not specified is 139.
  1091. +
  1092. +This number is the port number that will be used when making connections to
  1093. +the server. The standard (well-known) port number for the server is 139, 
  1094. +hence the default.
  1095. +
  1096. +This parameter is not normally specified.
  1097. +.RE
  1098. +
  1099. +.SH OPERATIONS
  1100. +Once the client is running, the user is presented with a prompt, "smb: \\>".
  1101. +The backslash ("\\") indicates the current working directory on the server,
  1102. +and will change if the current working directory is changed.
  1103. +
  1104. +The prompt indicates that the client is ready and waiting to carry out a user
  1105. +command. Each command is a single word, optionally followed by parameters
  1106. +specific to that command. Command and parameters are space-delimited unless
  1107. +these notes specifically state otherwise. All commands are case-insensitive.
  1108. +Parameters to commands may or may not be case sensitive, depending on the
  1109. +command.
  1110. +
  1111. +You can specify file names which have spaces in them by quoting the
  1112. +name with double quotes, for example "a long file name".
  1113. +
  1114. +Parameters shown in square brackets (eg., "[parameter]") are optional. If not
  1115. +given, the command will use suitable defaults. Parameters shown in angle
  1116. +brackets (eg., "<parameter>") are required.
  1117. +
  1118. +Note that all commands operating on the server are actually performed by
  1119. +issuing a request to the server. Thus the behaviour may vary from server to
  1120. +server, depending on how the server was implemented.
  1121. +
  1122. +The commands available are given here in alphabetical order.
  1123. +
  1124. +.B ?
  1125. +.RS 3
  1126. +.B Parameters:
  1127. +.RS 3
  1128. +.I [command]
  1129. +
  1130. +.RE
  1131. +.B Description:
  1132. +.RS 3
  1133. +If
  1134. +.I command
  1135. +is specified, the
  1136. +.B ?
  1137. +command will display a brief informative message about the specified command.
  1138. +
  1139. +If no command is specified, a list of available commands will be displayed.
  1140. +.RE
  1141. +.RE
  1142. +
  1143. +.B !
  1144. +.RS 3
  1145. +.B Parameters:
  1146. +.RS 3
  1147. +.I [shell command]
  1148. +
  1149. +.RE
  1150. +.B Description:
  1151. +.RS 3
  1152. +If
  1153. +.I shell command
  1154. +is specified, the
  1155. +.B !
  1156. +command will execute a shell locally and run the specified shell command. If
  1157. +no command is specified, a shell will be run.
  1158. +.RE
  1159. +.RE
  1160. +
  1161. +.B cd
  1162. +.RS 3
  1163. +.B Parameters:
  1164. +.RS 3
  1165. +.I [directory name]
  1166. +
  1167. +.RE
  1168. +.B Description:
  1169. +.RS 3
  1170. +If
  1171. +.I directory name
  1172. +is specified, the current working directory
  1173. +.B on the server
  1174. +will be changed to the directory specified. This operation will fail if for
  1175. +any reason the specified directory is inaccessible.
  1176. +
  1177. +If no directory name is specified, the current working directory
  1178. +.B on the server
  1179. +will be reported.
  1180. +.RE
  1181. +.RE
  1182. +
  1183. +.B del
  1184. +.RS 3
  1185. +.B Parameters:
  1186. +.RS 3
  1187. +.I <mask>
  1188. +
  1189. +.RE
  1190. +.B Description:
  1191. +.RS 3
  1192. +The client will request that the server attempt to delete all files matching
  1193. +.I mask
  1194. +from the current working directory
  1195. +.B on the server.
  1196. +.RE
  1197. +.RE
  1198. +
  1199. +.B dir
  1200. +.RS 3
  1201. +.B Parameters:
  1202. +.RS 3
  1203. +.I <mask>
  1204. +
  1205. +.RE
  1206. +.B Description:
  1207. +.RS 3
  1208. +A list of the files matching
  1209. +.I mask
  1210. +in the current working directory
  1211. +.B on the server
  1212. +will be retrieved from the server and displayed.
  1213. +.RE
  1214. +.RE
  1215. +
  1216. +.B exit
  1217. +.RS 3
  1218. +.B Parameters:
  1219. +.RS 3
  1220. +None.
  1221. +
  1222. +.RE
  1223. +.B Description:
  1224. +.RS 3
  1225. +Terminate the connection with the server and exit from the program.
  1226. +.RE
  1227. +.RE
  1228. +
  1229. +.B get
  1230. +.RS 3
  1231. +.B Parameters:
  1232. +.RS 3
  1233. +.I <remote file name> [local file name]
  1234. +
  1235. +.RE
  1236. +.B Description:
  1237. +.RS 3
  1238. +Copy the file called
  1239. +.I remote file name
  1240. +from the server to the machine running the client. If specified, name the
  1241. +local copy
  1242. +.I local file name.
  1243. +Note that all transfers in smbclient are binary. See also the
  1244. +.B lowercase
  1245. +command.
  1246. +.RE
  1247. +.RE
  1248. +
  1249. +.B help
  1250. +.RS 3
  1251. +.B Parameters:
  1252. +.RS 3
  1253. +.I [command]
  1254. +
  1255. +.RE
  1256. +.B Description:
  1257. +.RS 3
  1258. +See the
  1259. +.B ?
  1260. +command above.
  1261. +.RE
  1262. +.RE
  1263. +
  1264. +.B lcd
  1265. +.RS 3
  1266. +.B Parameters:
  1267. +.RS 3
  1268. +.I [directory name]
  1269. +
  1270. +.RE
  1271. +.B Description:
  1272. +.RS 3
  1273. +If
  1274. +.I directory name
  1275. +is specified, the current working directory
  1276. +.B on the local machine
  1277. +will be changed to the directory specified. This operation will fail if for
  1278. +any reason the specified directory is inaccessible.
  1279. +
  1280. +If no directory name is specified, the name of the current working directory
  1281. +.B on the local machine
  1282. +will be reported.
  1283. +.RE
  1284. +.RE
  1285. +
  1286. +.B lowercase
  1287. +.RS 3
  1288. +.B Parameters:
  1289. +.RS 3
  1290. +None.
  1291. +
  1292. +.RE
  1293. +.B Description:
  1294. +.RS 3
  1295. +Toggle lowercasing of filenames for the
  1296. +.B get
  1297. +and
  1298. +.B mget
  1299. +commands.
  1300. +
  1301. +When lowercasing is toggled ON, local filenames are converted to lowercase
  1302. +when using the
  1303. +.B get
  1304. +and
  1305. +.B mget
  1306. +commands. This is often useful when copying (say) MSDOS files from a server,
  1307. +because lowercase filenames are the norm on Unix systems.
  1308. +.RE
  1309. +.RE
  1310. +
  1311. +.B ls
  1312. +.RS 3
  1313. +.B Parameters:
  1314. +.RS 3
  1315. +.I <mask>
  1316. +
  1317. +.RE
  1318. +.B Description:
  1319. +.RS 3
  1320. +See the
  1321. +.B dir
  1322. +command above.
  1323. +.RE
  1324. +.RE
  1325. +
  1326. +.B mask
  1327. +.RS 3
  1328. +.B Parameters:
  1329. +.RS 3
  1330. +.I <mask>
  1331. +
  1332. +.RE
  1333. +.B Description:
  1334. +.RS 3
  1335. +This command allows the user to set up a mask which will be used during
  1336. +recursive operation of the
  1337. +.B mget
  1338. +and
  1339. +.B mput
  1340. +commands.
  1341. +
  1342. +The masks specified to the
  1343. +.B mget
  1344. +and
  1345. +.B mput
  1346. +commands act as filters for directories
  1347. +rather than files when recursion is toggled ON.
  1348. +
  1349. +The mask specified with the
  1350. +.B mask
  1351. +command is necessary to filter files within those directories. For example,
  1352. +if the mask specified in an
  1353. +.B mget
  1354. +command is "source*"
  1355. +.I and
  1356. +the mask specified with the
  1357. +.B mask
  1358. +command is "*.c"
  1359. +.I and
  1360. +recursion is toggled ON, the
  1361. +.B mget
  1362. +command will retrieve all files matching "*.c" in all directories below
  1363. +and including all directories matching "source*" in the current working 
  1364. +directory.
  1365. +
  1366. +Note that the value for
  1367. +.I mask
  1368. +defaults to blank (equivalent to "*") and remains so until the
  1369. +.B mask
  1370. +command is used to change it. It retains the most recently specified value
  1371. +indefinitely. To avoid unexpected results it would be wise to change the
  1372. +value of
  1373. +.I mask
  1374. +back to "*" after using the
  1375. +.B mget
  1376. +or
  1377. +.B mput
  1378. +commands.
  1379. +.RE
  1380. +.RE
  1381. +
  1382. +.B md
  1383. +.RS 3
  1384. +.B Parameters:
  1385. +.RS 3
  1386. +.I <directory name>
  1387. +
  1388. +.RE
  1389. +.B Description:
  1390. +.RS 3
  1391. +See the
  1392. +.B mkdir
  1393. +command.
  1394. +.RE
  1395. +.RE
  1396. +
  1397. +.B mget
  1398. +.RS 3
  1399. +.B Parameters:
  1400. +.RS 3
  1401. +.I <mask>
  1402. +
  1403. +.RE
  1404. +.B Description:
  1405. +.RS 3
  1406. +Copy all files matching
  1407. +.I mask
  1408. +from the server to the machine running the client.
  1409. +
  1410. +Note that
  1411. +.I mask
  1412. +is interpreted differently during recursive operation and non-recursive
  1413. +operation - refer to the
  1414. +.B recurse
  1415. +and
  1416. +.B mask
  1417. +commands for more information. Note that all transfers in smbclient are 
  1418. +binary. See also the
  1419. +.B lowercase
  1420. +command.
  1421. +.RE
  1422. +.RE
  1423. +
  1424. +.B mkdir
  1425. +.RS 3
  1426. +.B Parameters:
  1427. +.RS 3
  1428. +.I <directory name>
  1429. +
  1430. +.RE
  1431. +.B Description:
  1432. +.RS 3
  1433. +Create a new directory 
  1434. +.B on the server
  1435. +(user access privileges permitting) with the specified name.
  1436. +.RE
  1437. +.RE
  1438. +
  1439. +.B mput
  1440. +.RS 3
  1441. +.B Parameters:
  1442. +.RS 3
  1443. +.I <mask>
  1444. +
  1445. +.RE
  1446. +.B Description:
  1447. +.RS 3
  1448. +Copy all files matching
  1449. +.I mask
  1450. +in the current working directory
  1451. +.B on the local machine
  1452. +to the current working directory on the server.
  1453. +
  1454. +Note that
  1455. +.I mask
  1456. +is interpreted differently during recursive operation and non-recursive
  1457. +operation - refer to the
  1458. +.B recurse
  1459. +and
  1460. +.B mask
  1461. +commands for more information. Note that all transfers in smbclient are 
  1462. +binary.
  1463. +.RE
  1464. +.RE
  1465. +
  1466. +.B print
  1467. +.RS 3
  1468. +.B Parameters:
  1469. +.RS 3
  1470. +.I <file name>
  1471. +
  1472. +.RE
  1473. +.B Description:
  1474. +.RS 3
  1475. +Print the specified file
  1476. +.B from the local machine
  1477. +through a printable service on the server.
  1478. +
  1479. +See also the
  1480. +.B printmode
  1481. +command.
  1482. +.RE
  1483. +.RE
  1484. +
  1485. +.B printmode
  1486. +.RS 3
  1487. +.B Parameters:
  1488. +.RS 3
  1489. +.I <graphics or text>
  1490. +
  1491. +.RE
  1492. +.B Description:
  1493. +.RS 3
  1494. +Set the print mode to suit either binary data (such as graphical information)
  1495. +or text. Subsequent
  1496. +.B print
  1497. +commands will use the currently set print mode.
  1498. +.RE
  1499. +.RE
  1500. +
  1501. +.B prompt
  1502. +.RS 3
  1503. +.B Parameters:
  1504. +.RS 3
  1505. +None.
  1506. +
  1507. +.RE
  1508. +.B Description:
  1509. +.RS 3
  1510. +Toggle prompting for filenames during operation of the
  1511. +.B mget
  1512. +and
  1513. +.B mput
  1514. +commands.
  1515. +
  1516. +When toggled ON, the user will be prompted to confirm the transfer of each
  1517. +file during these commands. When toggled OFF, all specified files will be
  1518. +transferred without prompting.
  1519. +.RE
  1520. +.RE
  1521. +
  1522. +.B put
  1523. +.RS 3
  1524. +.B Parameters:
  1525. +.RS 3
  1526. +.I <local file name> [remote file name]
  1527. +
  1528. +.RE
  1529. +.B Description:
  1530. +.RS 3
  1531. +Copy the file called
  1532. +.I local file name
  1533. +from the machine running the client to the server. If specified, name the
  1534. +remote copy
  1535. +.I remote file name.
  1536. +Note that all transfers in smbclient are binary. See also the
  1537. +.B lowercase
  1538. +command.
  1539. +.RE
  1540. +.RE
  1541. +
  1542. +.B queue
  1543. +.RS 3
  1544. +.B Parameters:
  1545. +.RS 3
  1546. +None.
  1547. +
  1548. +.RE
  1549. +.B Description:
  1550. +.RS 3
  1551. +Displays the print queue, showing the job id, name, size and current status.
  1552. +.RE
  1553. +.RE
  1554. +
  1555. +.B quit
  1556. +.RS 3
  1557. +.B Parameters:
  1558. +.RS 3
  1559. +None.
  1560. +
  1561. +.RE
  1562. +.B Description:
  1563. +.RS 3
  1564. +See the
  1565. +.B exit
  1566. +command.
  1567. +.RE
  1568. +.RE
  1569. +
  1570. +.B rd
  1571. +.RS 3
  1572. +.B Parameters:
  1573. +.RS 3
  1574. +.I <directory name>
  1575. +
  1576. +.RE
  1577. +.B Description:
  1578. +.RS 3
  1579. +See the
  1580. +.B rmdir
  1581. +command.
  1582. +.RE
  1583. +.RE
  1584. +
  1585. +.B recurse
  1586. +.RS 3
  1587. +.B Parameters:
  1588. +.RS 3
  1589. +None.
  1590. +
  1591. +.RE
  1592. +.B Description:
  1593. +.RS 3
  1594. +Toggle directory recursion for the commands
  1595. +.B mget
  1596. +and
  1597. +.B mput
  1598. +.
  1599. +
  1600. +When toggled ON, these commands will process all directories in the source
  1601. +directory (ie., the directory they are copying
  1602. +.I from
  1603. +) and will recurse into any that match the mask specified to the command. Only
  1604. +files that match the mask specified using the
  1605. +.B mask
  1606. +command will be retrieved. See also the
  1607. +.mask
  1608. +command.
  1609. +
  1610. +When recursion is toggled OFF, only files from the current working
  1611. +directory on the source machine that match the mask specified to the
  1612. +.B mget
  1613. +or
  1614. +.B mput
  1615. +commands will be copied, and any mask specified using the
  1616. +.B mask
  1617. +command will be ignored.
  1618. +.RE
  1619. +.RE
  1620. +
  1621. +.B rm
  1622. +.RS 3
  1623. +.B Parameters:
  1624. +.RS 3
  1625. +.I <mask>
  1626. +
  1627. +.RE
  1628. +.B Description:
  1629. +.RS 3
  1630. +Remove all files matching
  1631. +.I mask
  1632. +from the current working directory
  1633. +.B on the server.
  1634. +.RE
  1635. +.RE
  1636. +
  1637. +.B rmdir
  1638. +.RS 3
  1639. +.B Parameters:
  1640. +.RS 3
  1641. +.I <directory name>
  1642. +
  1643. +.RE
  1644. +.B Description:
  1645. +.RS 3
  1646. +Remove the specified directory (user access privileges permitting)
  1647. +.B from the server.
  1648. +.RE
  1649. +.RE
  1650. +
  1651. +
  1652. +.SH NOTES
  1653. +Some servers are fussy about the case of supplied usernames, passwords, share
  1654. +names (aka service names) and machine names. If you fail to connect try
  1655. +giving all parameters in uppercase.
  1656. +
  1657. +It is often necessary to use the
  1658. +.B -n
  1659. +option when connecting to some types
  1660. +of servers. For example OS/2 LanManager insists on a valid netbios name
  1661. +being used, so you need to supply a valid name that would be known to
  1662. +the server.
  1663. +
  1664. +.B smbclient
  1665. +supports long file names where the server supports the LANMAN2
  1666. +protocol.
  1667. +
  1668. +.SH FILES
  1669. +Not applicable.
  1670. +
  1671. +.SH ENVIRONMENT VARIABLES
  1672. +.B USER
  1673. +.RS 3
  1674. +The variable USER may contain the username of the person using the client.
  1675. +This information is used only if the protocol level is high enough to support
  1676. +session-level passwords.
  1677. +.RE
  1678. +
  1679. +.SH INSTALLATION
  1680. +The location of the client program is a matter for individual system 
  1681. +administrators. The following are thus suggestions only.
  1682. +
  1683. +It is recommended that the client software be installed under the /usr/local
  1684. +hierarchy, in a directory readable by all, writeable only by root. The client
  1685. +program itself should be executable by all. The client should NOT be setuid 
  1686. +or setgid!
  1687. +
  1688. +The client log files should be put in a directory readable and writable only
  1689. +by the user.
  1690. +
  1691. +To test the client, you will need to know the name of a running Lan manager
  1692. +server. It is possible to run the smbd (see
  1693. +.B smbd(8)) as an ordinary user - running that server as a daemon on a
  1694. +user-accessible port (typically any port number over 1024) would
  1695. +provide a suitable test server.
  1696. +.SH VERSION
  1697. +This man page is (mostly) correct for version 1.9.00 of the Samba suite, plus some
  1698. +of the recent patches to it. These notes will necessarily lag behind 
  1699. +development of the client software, so it is possible that your version of 
  1700. +the client has extensions or parameter semantics that differ from or are not 
  1701. +covered by this man page. Please notify these to the address below for 
  1702. +rectification.
  1703. +.SH SEE ALSO
  1704. +.B smbd(8)
  1705. +
  1706. +.SH DIAGNOSTICS
  1707. +[This section under construction]
  1708. +
  1709. +Most diagnostics issued by the client are logged in a specified log file. The
  1710. +log file name is specified at compile time, but may be overridden on the
  1711. +command line.
  1712. +
  1713. +The number and nature of diagnostics available depends on the debug level used
  1714. +by the client. If you have problems, set the debug level to 3 and peruse the
  1715. +log files.
  1716. +
  1717. +Most messages are reasonably self-explanatory. Unfortunately, at time of
  1718. +creation of this man page the source code is still too fluid to warrant
  1719. +describing each and every diagnostic. At this stage your best bet is still
  1720. +to grep the source code and inspect the conditions that gave rise to the 
  1721. +diagnostics you are seeing.
  1722. +
  1723. +.SH BUGS
  1724. +None known.
  1725. +.SH CREDITS
  1726. +The original Samba software and related utilities were created by 
  1727. +Andrew Tridgell (samba-bugs@anu.edu.au). Andrew is also the Keeper
  1728. +of the Source for this project.
  1729. +
  1730. +This man page written by Karl Auer (Karl.Auer@anu.edu.au)
  1731. +
  1732. +See
  1733. +.B smb.conf(5) for a full list of contributors and details on how to 
  1734. +submit bug reports, comments etc.
  1735. diff -u -r --new-file last-version/docs/smbd.8 samba-1.9.15p5/docs/smbd.8
  1736. --- last-version/docs/smbd.8    Wed Nov 22 22:28:10 1995
  1737. +++ samba-1.9.15p5/docs/smbd.8    Sun Dec  3 18:50:56 1995
  1738. @@ -35,12 +35,14 @@
  1739.  An extensive description of the services that the server can provide is given
  1740.  in the man page for the configuration file controlling the attributes of those
  1741.  services (see
  1742. -.B smb.conf(5)). This man page will not describe the services, but
  1743. +.B smb.conf(5)).
  1744. +This man page will not describe the services, but
  1745.  will concentrate on the administrative aspects of running the server.
  1746.  
  1747.  Please note that there are significant security implications to running this
  1748.  server, and
  1749. -.B smb.conf(5) should be regarded as mandatory reading before proceeding with 
  1750. +.B smb.conf(5)
  1751. +should be regarded as mandatory reading before proceeding with 
  1752.  installation.
  1753.  
  1754.  A session is created whenever a client requests one. Each client gets a copy
  1755. @@ -186,7 +188,7 @@
  1756.  clients. See
  1757.  .B smb.conf(5) for more information.
  1758.  .RE
  1759. -.RE
  1760. +.\" .RE
  1761.  
  1762.  .SH LIMITATIONS
  1763.  
  1764. @@ -403,5 +405,6 @@
  1765.  This man page written by Karl Auer (Karl.Auer@anu.edu.au)
  1766.  
  1767.  See
  1768. -.B smb.conf(5) for a full list of contributors and details on how to 
  1769. +.B smb.conf(5)
  1770. +for a full list of contributors and details on how to 
  1771.  submit bug reports, comments etc.
  1772. diff -u -r --new-file last-version/docs/smbd.8.orig samba-1.9.15p5/docs/smbd.8.orig
  1773. --- last-version/docs/smbd.8.orig    Thu Jan  1 10:00:00 1970
  1774. +++ samba-1.9.15p5/docs/smbd.8.orig    Wed Nov 22 22:28:10 1995
  1775. @@ -0,0 +1,407 @@
  1776. +.TH SMBD 8 17/1/1995 smbd smbd
  1777. +.SH NAME
  1778. +smbd \- provide SMB (aka LanManager) services to clients
  1779. +.SH SYNOPSIS
  1780. +.B smbd
  1781. +[
  1782. +.B -D
  1783. +] [
  1784. +.B -a
  1785. +] [
  1786. +.B -d
  1787. +.I debuglevel
  1788. +] [
  1789. +.B -l
  1790. +.I log file
  1791. +] [
  1792. +.B -p
  1793. +.I port number
  1794. +] [
  1795. +.B -O
  1796. +.I socket options
  1797. +] [
  1798. +.B -s
  1799. +.I configuration file
  1800. +]
  1801. +.SH DESCRIPTION
  1802. +This program is part of the Samba suite.
  1803. +
  1804. +.B smbd
  1805. +is a server that can provide most SMB services. The 
  1806. +server provides filespace and printer services to clients using the SMB 
  1807. +protocol. This is compatible with the LanManager protocol, and can
  1808. +service LanManager clients.
  1809. +
  1810. +An extensive description of the services that the server can provide is given
  1811. +in the man page for the configuration file controlling the attributes of those
  1812. +services (see
  1813. +.B smb.conf(5)). This man page will not describe the services, but
  1814. +will concentrate on the administrative aspects of running the server.
  1815. +
  1816. +Please note that there are significant security implications to running this
  1817. +server, and
  1818. +.B smb.conf(5) should be regarded as mandatory reading before proceeding with 
  1819. +installation.
  1820. +
  1821. +A session is created whenever a client requests one. Each client gets a copy
  1822. +of the server for each session. This copy then services all connections made
  1823. +by the client during that session. When all connections from its client are
  1824. +are closed, the copy of the server for that client terminates.
  1825. +
  1826. +The configuration file is automatically reloaded if it changes. You
  1827. +can force a reload by sending a SIGHUP to the server.
  1828. +
  1829. +.SH OPTIONS
  1830. +.B -D
  1831. +
  1832. +.RS 3
  1833. +If specified, this parameter causes the server to operate as a daemon. That is,
  1834. +it detaches itself and runs in the background, fielding requests on the 
  1835. +appropriate port.
  1836. +
  1837. +By default, the server will NOT operate as a daemon.
  1838. +.RE
  1839. +
  1840. +.B -a
  1841. +
  1842. +.RS 3
  1843. +If this parameter is specified, the log files will be overwritten with each 
  1844. +new connection. By default, the log files will be appended to.
  1845. +.RE
  1846. +
  1847. +.B -d
  1848. +.I debuglevel
  1849. +.RS 3
  1850. +
  1851. +debuglevel is an integer from 0 to 5.
  1852. +
  1853. +The default value if this parameter is not specified is zero.
  1854. +
  1855. +The higher this value, the more detail will be logged to the log files about
  1856. +the activities of the server. At level 0, only critical errors and serious 
  1857. +warnings will be logged. Level 1 is a reasonable level for day to day running
  1858. +- it generates a small amount of information about operations carried out.
  1859. +
  1860. +Levels above 1 will generate considerable amounts of log data, and should 
  1861. +only be used when investigating a problem. Levels above 3 are designed for 
  1862. +use only by developers and generate HUGE amounts of log data, most of which 
  1863. +is extremely cryptic.
  1864. +.RE
  1865. +
  1866. +.B -l
  1867. +.I log file
  1868. +
  1869. +.RS 3
  1870. +If specified,
  1871. +.I logfile
  1872. +specifies a base filename into which operational data from the running server
  1873. +will be logged.
  1874. +
  1875. +The default base name is specified at compile time.
  1876. +
  1877. +The base name is used to generate actual log file names. For example, if the
  1878. +name specified was "log", the following files would be used for log data:
  1879. +
  1880. +.RS 3
  1881. +log.debug (containing debugging information)
  1882. +
  1883. +log.in (containing inbound transaction data)
  1884. +
  1885. +log.out (containing outbound transaction data)
  1886. +.RE
  1887. +
  1888. +The log files generated are never removed by the server.
  1889. +.RE
  1890. +
  1891. +.B -O
  1892. +.I socket options
  1893. +.RS 3
  1894. +
  1895. +See the socket options section of smb.conf(5) for details
  1896. +
  1897. +.RE
  1898. +.B -p
  1899. +.I port number
  1900. +.RS 3
  1901. +
  1902. +port number is a positive integer value.
  1903. +
  1904. +The default value if this parameter is not specified is 139.
  1905. +
  1906. +This number is the port number that will be used when making connections to
  1907. +the server from client software. The standard (well-known) port number for the
  1908. +server is 139, hence the default. If you wish to run the server as an ordinary
  1909. +user rather than as root, most systems will require you to use a port number
  1910. +greater than 1024 - ask your system administrator for help if you are in this
  1911. +situation.
  1912. +
  1913. +This parameter is not normally specified except in the above situation.
  1914. +.RE
  1915. +
  1916. +.B -s
  1917. +.I configuration file
  1918. +
  1919. +.RS 3
  1920. +The default configuration file name is determined at compile time.
  1921. +
  1922. +The file specified contains the configuration details required by the server.
  1923. +The information in this file includes server-specific information such as
  1924. +what printcap file to use, as well as descriptions of all the services that the
  1925. +server is to provide. See
  1926. +.B smb.conf(5) for more information.
  1927. +.RE
  1928. +
  1929. +.SH FILES
  1930. +
  1931. +.B /etc/inetd.conf
  1932. +
  1933. +.RS 3
  1934. +If the server is to be run by the inetd meta-daemon, this file must contain
  1935. +suitable startup information for the meta-daemon. See the section 
  1936. +"INSTALLATION" below.
  1937. +.RE
  1938. +
  1939. +.B /etc/rc
  1940. +
  1941. +.RS 3
  1942. +(or whatever initialisation script your system uses)
  1943. +
  1944. +If running the server as a daemon at startup, this file will need to contain
  1945. +an appropriate startup sequence for the server. See the section "INSTALLATION"
  1946. +below.
  1947. +.RE
  1948. +
  1949. +.B /etc/services
  1950. +
  1951. +.RS 3
  1952. +If running the server via the meta-daemon inetd, this file must contain a
  1953. +mapping of service name (eg., netbios-ssn)  to service port (eg., 139) and
  1954. +protocol type (eg., tcp). See the section "INSTALLATION" below.
  1955. +.RE
  1956. +
  1957. +.B /usr/local/smb/smb.conf
  1958. +
  1959. +.RS 3
  1960. +This file describes all the services the server is to make available to
  1961. +clients. See
  1962. +.B smb.conf(5) for more information.
  1963. +.RE
  1964. +.RE
  1965. +
  1966. +.SH LIMITATIONS
  1967. +
  1968. +On some systems smbd cannot change uid back to root after a setuid() call.
  1969. +Such systems are called "trapdoor" uid systems. If you have such a system,
  1970. +you will be unable to connect from a client (such as a PC) as two different
  1971. +users at once. Attempts to connect the second user will result in "access
  1972. +denied" or similar.
  1973. +
  1974. +.SH ENVIRONMENT VARIABLES
  1975. +
  1976. +.B PRINTER
  1977. +
  1978. +.RS 3
  1979. +If no printer name is specified to printable services, most systems will
  1980. +use the value of this variable (or "lp" if this variable is not defined)
  1981. +as the name of the printer to use. This is not specific to the server,
  1982. +however.
  1983. +.RE
  1984. +
  1985. +.SH INSTALLATION
  1986. +The location of the server and its support files is a matter for individual
  1987. +system administrators. The following are thus suggestions only.
  1988. +
  1989. +It is recommended that the server software be installed under the
  1990. +/usr/local hierarchy, in a directory readable by all, writeable only
  1991. +by root. The server program itself should be executable by all, as
  1992. +users may wish to run the server themselves (in which case it will of
  1993. +course run with their privileges).  The server should NOT be
  1994. +setuid. On some systems it may be worthwhile to make smbd setgid to an
  1995. +empty group. This is because some systems may have a security hole where
  1996. +daemon processes that become a user can be attached to with a
  1997. +debugger. Making the smbd file setgid to an empty group may prevent
  1998. +this hole from being exploited. This secrity hole and the suggested
  1999. +fix has only been confirmed on Linux at the time this was written. It
  2000. +is possible that this hole only exists in Linux, as testing on other
  2001. +systems has thus far shown them to be immune.
  2002. +
  2003. +The server log files should be put in a directory readable and writable only
  2004. +by root, as the log files may contain sensitive information.
  2005. +
  2006. +The configuration file should be placed in a directory readable and writable
  2007. +only by root, as the configuration file controls security for the services
  2008. +offered by the server. The configuration file can be made readable by all if
  2009. +desired, but this is not necessary for correct operation of the server and
  2010. +is not recommended. A sample configuration file "smb.conf.sample" is supplied
  2011. +with the source to the server - this may be renamed to "smb.conf" and 
  2012. +modified to suit your needs.
  2013. +
  2014. +The remaining notes will assume the following:
  2015. +
  2016. +.RS 3
  2017. +smbd (the server program) installed in /usr/local/smb
  2018. +
  2019. +smb.conf (the configuration file) installed in /usr/local/smb
  2020. +
  2021. +log files stored in /var/adm/smblogs
  2022. +.RE
  2023. +
  2024. +The server may be run either as a daemon by users or at startup, or it may
  2025. +be run from a meta-daemon such as inetd upon request. If run as a daemon, the
  2026. +server will always be ready, so starting sessions will be faster. If run from 
  2027. +a meta-daemon some memory will be saved and utilities such as the tcpd 
  2028. +TCP-wrapper may be used for extra security.
  2029. +
  2030. +When you've decided, continue with either "RUNNING THE SERVER AS A DAEMON" or
  2031. +"RUNNING THE SERVER ON REQUEST".
  2032. +.SH RUNNING THE SERVER AS A DAEMON
  2033. +To run the server as a daemon from the command line, simply put the "-D" option
  2034. +on the command line. There is no need to place an ampersand at the end of the
  2035. +command line - the "-D" option causes the server to detach itself from the
  2036. +tty anyway.
  2037. +
  2038. +Any user can run the server as a daemon (execute permissions permitting, of 
  2039. +course). This is useful for testing purposes, and may even be useful as a
  2040. +temporary substitute for something like ftp. When run this way, however, the
  2041. +server will only have the privileges of the user who ran it.
  2042. +
  2043. +To ensure that the server is run as a daemon whenever the machine is started,
  2044. +and to ensure that it runs as root so that it can serve multiple clients, you 
  2045. +will need to modify the system startup files. Wherever appropriate (for
  2046. +example, in /etc/rc), insert the following line, substituting 
  2047. +port number, log file location, configuration file location and debug level as
  2048. +desired:
  2049. +
  2050. +.RS 3
  2051. +/usr/local/smb/smbd -D -l /var/adm/smblogs/log -s /usr/local/smb/smb.conf
  2052. +.RE
  2053. +
  2054. +(The above should appear in your initialisation script as a single line. 
  2055. +Depending on your terminal characteristics, it may not appear that way in
  2056. +this man page. If the above appears as more than one line, please treat any 
  2057. +newlines or indentation as a single space or TAB character.)
  2058. +
  2059. +If the options used at compile time are appropriate for your system, all
  2060. +parameters except the desired debug level and "-D" may be omitted. See the
  2061. +section "OPTIONS" above.
  2062. +.SH RUNNING THE SERVER ON REQUEST
  2063. +If your system uses a meta-daemon such as inetd, you can arrange to have the
  2064. +smbd server started whenever a process attempts to connect to it. This requires
  2065. +several changes to the startup files on the host machine. If you are
  2066. +experimenting as an ordinary user rather than as root, you will need the 
  2067. +assistance of your system administrator to modify the system files.
  2068. +
  2069. +You will probably want to set up the name server
  2070. +.B nmbd
  2071. +at the same time as
  2072. +the smbd - refer to the man page 
  2073. +.B nmbd(8).
  2074. +
  2075. +First, ensure that a port is configured in the file /etc/services. The 
  2076. +well-known port 139 should be used if possible, though any port may be used.
  2077. +
  2078. +Ensure that a line similar to the following is in /etc/services:
  2079. +
  2080. +.RS 3
  2081. +netbios-ssn    139/tcp
  2082. +.RE
  2083. +
  2084. +Note for NIS/YP users - you may need to rebuild the NIS service maps rather
  2085. +than alter your local /etc/services file.
  2086. +
  2087. +Next, put a suitable line in the file /etc/inetd.conf (in the unlikely event
  2088. +that you are using a meta-daemon other than inetd, you are on your own). Note
  2089. +that the first item in this line matches the service name in /etc/services.
  2090. +Substitute appropriate values for your system in this line (see
  2091. +.B inetd(8)):
  2092. +
  2093. +.RS 3
  2094. +netbios-ssn stream tcp nowait root /usr/local/smb/smbd -d1 
  2095. +-l/var/adm/smblogs/log -s/usr/local/smb/smb.conf
  2096. +.RE
  2097. +
  2098. +(The above should appear in /etc/inetd.conf as a single line. Depending on 
  2099. +your terminal characteristics, it may not appear that way in this man page.
  2100. +If the above appears as more than one line, please treat any newlines or 
  2101. +indentation as a single space or TAB character.)
  2102. +
  2103. +Note that there is no need to specify a port number here, even if you are 
  2104. +using a non-standard port number.
  2105. +
  2106. +Lastly, edit the configuration file to provide suitable services. To start
  2107. +with, the following two services should be all you need:
  2108. +
  2109. +.RS 3
  2110. +[homes]
  2111. +.RS 3
  2112. + writable = yes
  2113. +.RE
  2114. +
  2115. +[printers]
  2116. +.RS 3
  2117. + writable = no
  2118. + printable = yes
  2119. + path = /tmp
  2120. + public = yes
  2121. +.RE
  2122. +.RE
  2123. +
  2124. +This will allow you to connect to your home directory and print to any printer
  2125. +supported by the host (user privileges permitting).
  2126. +.SH TESTING THE INSTALLATION
  2127. +If running the server as a daemon, execute it before proceeding. If
  2128. +using a meta-daemon, either restart the system or kill and restart the 
  2129. +meta-daemon. Some versions of inetd will reread their configuration tables if
  2130. +they receive a HUP signal.
  2131. +
  2132. +If your machine's name is "fred" and your name is "mary", you should now be
  2133. +able to connect to the service "\\\\fred\\mary".
  2134. +
  2135. +To properly test and experiment with the server, we recommend using the
  2136. +smbclient program (see
  2137. +.B smbclient(1)).
  2138. +.SH VERSION
  2139. +This man page is (mostly) correct for version 1.9.00 of the Samba suite, plus some
  2140. +of the recent patches to it. These notes will necessarily lag behind 
  2141. +development of the software, so it is possible that your version of 
  2142. +the server has extensions or parameter semantics that differ from or are not 
  2143. +covered by this man page. Please notify these to the address below for 
  2144. +rectification.
  2145. +.SH SEE ALSO
  2146. +.B hosts_access(5),
  2147. +.B inetd(8),
  2148. +.B nmbd(8), 
  2149. +.B smb.conf(5),
  2150. +.B smbclient(1),
  2151. +.B testparm(1), 
  2152. +.B testprns(1)
  2153. +
  2154. +.SH DIAGNOSTICS
  2155. +[This section under construction]
  2156. +
  2157. +Most diagnostics issued by the server are logged in a specified log file. The
  2158. +log file name is specified at compile time, but may be overridden on the
  2159. +command line.
  2160. +
  2161. +The number and nature of diagnostics available depends on the debug level used
  2162. +by the server. If you have problems, set the debug level to 3 and peruse the
  2163. +log files.
  2164. +
  2165. +Most messages are reasonably self-explanatory. Unfortunately, at time of
  2166. +creation of this man page the source code is still too fluid to warrant
  2167. +describing each and every diagnostic. At this stage your best bet is still
  2168. +to grep the source code and inspect the conditions that gave rise to the 
  2169. +diagnostics you are seeing.
  2170. +
  2171. +.SH BUGS
  2172. +None known.
  2173. +.SH CREDITS
  2174. +The original Samba software and related utilities were created by 
  2175. +Andrew Tridgell (samba-bugs@anu.edu.au). Andrew is also the Keeper
  2176. +of the Source for this project.
  2177. +
  2178. +This man page written by Karl Auer (Karl.Auer@anu.edu.au)
  2179. +
  2180. +See
  2181. +.B smb.conf(5) for a full list of contributors and details on how to 
  2182. +submit bug reports, comments etc.
  2183. diff -u -r --new-file last-version/docs/smbrun.1 samba-1.9.15p5/docs/smbrun.1
  2184. --- last-version/docs/smbrun.1    Wed Nov 22 22:28:16 1995
  2185. +++ samba-1.9.15p5/docs/smbrun.1    Sun Dec  3 18:50:56 1995
  2186. @@ -66,5 +66,6 @@
  2187.  This man page was written by Karl Auer (Karl.Auer@anu.edu.au)
  2188.  
  2189.  See
  2190. -.B smb.conf(5) for a full list of contributors and details of how to 
  2191. +.B smb.conf(5)
  2192. +for a full list of contributors and details of how to 
  2193.  submit bug reports, comments etc.
  2194. diff -u -r --new-file last-version/docs/smbrun.1.orig samba-1.9.15p5/docs/smbrun.1.orig
  2195. --- last-version/docs/smbrun.1.orig    Thu Jan  1 10:00:00 1970
  2196. +++ samba-1.9.15p5/docs/smbrun.1.orig    Wed Nov 22 22:28:16 1995
  2197. @@ -0,0 +1,70 @@
  2198. +.TH SMBRUN 1 17/1/1995 smbrun smbrun
  2199. +.SH NAME
  2200. +smbrun \- interface program between smbd and external programs
  2201. +.SH SYNOPSIS
  2202. +.B smbrun
  2203. +.I shell-command
  2204. +.SH DESCRIPTION
  2205. +This program is part of the Samba suite.
  2206. +
  2207. +.B smbrun
  2208. +is a very small 'glue' program, which runs shell commands for
  2209. +the
  2210. +.B smbd
  2211. +daemon (see
  2212. +.B smbd(8)).
  2213. +
  2214. +It first changes to the highest effective user and group ID that it can, 
  2215. +then runs the command line provided using the system() call. This program is
  2216. +necessary to allow some operating systems to run external programs as non-root.
  2217. +.SH OPTIONS
  2218. +.I shell-command
  2219. +
  2220. +.RS 3
  2221. +The shell command to execute.
  2222. +
  2223. +The command should have a fully-qualified path.
  2224. +.RE
  2225. +.SH ENVIRONMENT VARIABLES
  2226. +The PATH variable set for the environment in which
  2227. +.B smbrun
  2228. +is executed will affect what executables are located and executed if a
  2229. +fully-qualified path is not given in the command.
  2230. +
  2231. +.SH INSTALLATION
  2232. +The location of the server and its support files is a matter for individual
  2233. +system administrators. The following are thus suggestions only.
  2234. +
  2235. +It is recommended that the
  2236. +.B smbrun
  2237. +program be installed under the /usr/local hierarchy, in a directory readable
  2238. +by all, writeable only by root. The program should be executable by all.
  2239. +The program should NOT be setuid or setgid!
  2240. +.SH VERSION
  2241. +This man page is (mostly) correct for version 1.9.00 of the Samba suite, plus some
  2242. +of the recent patches to it. These notes will necessarily lag behind 
  2243. +development of the software, so it is possible that your version of 
  2244. +the program has extensions or parameter semantics that differ from or are not 
  2245. +covered by this man page. Please notify these to the address below for 
  2246. +rectification.
  2247. +.SH SEE ALSO
  2248. +.B smbd(8), 
  2249. +.B smb.conf(8) 
  2250. +.SH DIAGNOSTICS
  2251. +If smbrun cannot be located or cannot be executed by
  2252. +.B smbd
  2253. +then appropriate messages will be found in the smbd logs. Other diagnostics are
  2254. +dependent on the shell-command being run. It is advisable for your shell
  2255. +commands to issue suitable diagnostics to aid trouble-shooting.
  2256. +.SH BUGS
  2257. +None known.
  2258. +.SH CREDITS
  2259. +The original Samba software and related utilities were created by 
  2260. +Andrew Tridgell (samba-bugs@anu.edu.au). Andrew is also the Keeper
  2261. +of the Source for this project.
  2262. +
  2263. +This man page was written by Karl Auer (Karl.Auer@anu.edu.au)
  2264. +
  2265. +See
  2266. +.B smb.conf(5) for a full list of contributors and details of how to 
  2267. +submit bug reports, comments etc.
  2268. diff -u -r --new-file last-version/docs/smbstatus.1 samba-1.9.15p5/docs/smbstatus.1
  2269. --- last-version/docs/smbstatus.1    Sat Nov  4 23:20:23 1995
  2270. +++ samba-1.9.15p5/docs/smbstatus.1    Sun Dec  3 18:50:56 1995
  2271. @@ -48,5 +48,6 @@
  2272.  .B smbd(8)
  2273.  
  2274.  See
  2275. -.B smb.conf(5) for a full list of contributors and details on how to 
  2276. +.B smb.conf(5)
  2277. +for a full list of contributors and details on how to 
  2278.  submit bug reports, comments etc.
  2279. diff -u -r --new-file last-version/docs/smbstatus.1.orig samba-1.9.15p5/docs/smbstatus.1.orig
  2280. --- last-version/docs/smbstatus.1.orig    Thu Jan  1 10:00:00 1970
  2281. +++ samba-1.9.15p5/docs/smbstatus.1.orig    Sat Nov  4 23:20:23 1995
  2282. @@ -0,0 +1,52 @@
  2283. +.TH SMBSTATUS 1 17/1/1995 smbstatus smbstatus
  2284. +.SH NAME
  2285. +smbstatus \- report on current Samba connections
  2286. +.SH SYNOPSIS
  2287. +.B smbstatus
  2288. +[-d]
  2289. +[-s
  2290. +.I configuration file
  2291. +]
  2292. +.SH DESCRIPTION
  2293. +This program is part of the Samba suite.
  2294. +
  2295. +.B smbstatus
  2296. +is a very simple program to list the current Samba connections
  2297. +
  2298. +Just run the program and the output is self explanatory. You can offer
  2299. +a configuration filename to override the default. The default is
  2300. +CONFIGFILE from the Makefile.
  2301. +
  2302. +Option
  2303. +.I -d
  2304. +gives verbose output.
  2305. +
  2306. +.I -p
  2307. +print a list of smbd processes and exit. Useful for scripting.
  2308. +
  2309. +.SH ENVIRONMENT VARIABLES
  2310. +Not applicable.
  2311. +
  2312. +.SH INSTALLATION
  2313. +The location of the server and its support files is a matter for individual
  2314. +system administrators. The following are thus suggestions only.
  2315. +
  2316. +It is recommended that the
  2317. +.B smbstatus
  2318. +program be installed under the /usr/local hierarchy, in a directory readable
  2319. +by all, writeable only by root. The program itself should be executable by all.
  2320. +
  2321. +.SH VERSION
  2322. +This man page is (mostly) correct for version 1.9.00 of the Samba suite, plus some
  2323. +of the recent patches to it. These notes will necessarily lag behind 
  2324. +development of the software, so it is possible that your version of 
  2325. +the program has extensions or parameter semantics that differ from or are not 
  2326. +covered by this man page. Please notify these to the address below for 
  2327. +rectification.
  2328. +.SH SEE ALSO
  2329. +.B smb.conf(5),
  2330. +.B smbd(8)
  2331. +
  2332. +See
  2333. +.B smb.conf(5) for a full list of contributors and details on how to 
  2334. +submit bug reports, comments etc.
  2335. diff -u -r --new-file last-version/docs/testparm.1 samba-1.9.15p5/docs/testparm.1
  2336. --- last-version/docs/testparm.1    Wed Nov 22 22:28:28 1995
  2337. +++ samba-1.9.15p5/docs/testparm.1    Sun Dec  3 18:50:56 1995
  2338. @@ -100,5 +100,6 @@
  2339.  (Karl.Auer@anu.edu.au)
  2340.  
  2341.  See
  2342. -.B samba(7) for a full list of contributors and details on how to 
  2343. +.B samba(7)
  2344. +for a full list of contributors and details on how to 
  2345.  submit bug reports, comments etc.
  2346. diff -u -r --new-file last-version/docs/testparm.1.orig samba-1.9.15p5/docs/testparm.1.orig
  2347. --- last-version/docs/testparm.1.orig    Thu Jan  1 10:00:00 1970
  2348. +++ samba-1.9.15p5/docs/testparm.1.orig    Wed Nov 22 22:28:28 1995
  2349. @@ -0,0 +1,104 @@
  2350. +.TH TESTPARM 1 17/1/1995 testparm testparm
  2351. +.SH NAME
  2352. +testparm \- check an smbd configuration file for internal correctness
  2353. +.SH SYNOPSIS
  2354. +.B testparm
  2355. +[
  2356. +.I configfilename
  2357. +[
  2358. +.I hostname
  2359. +.I hostIP
  2360. +]
  2361. +]
  2362. +.SH DESCRIPTION
  2363. +This program is part of the Samba suite.
  2364. +
  2365. +.B testparm
  2366. +is a very simple test program to check an
  2367. +.B smbd
  2368. +configuration
  2369. +file for internal correctness. If this program reports no problems, you can use
  2370. +the configuration file with confidence that smbd will successfully
  2371. +load the configuration file.
  2372. +
  2373. +Note that this is NOT a guarantee that the services specified in the
  2374. +configuration file will be available or will operate as expected.
  2375. +
  2376. +If the optional host name and host IP address are specified on the
  2377. +command line, this test program will run through the service entries
  2378. +reporting whether the specified host has access to each service.
  2379. +.SH OPTIONS
  2380. +.I configfilename
  2381. +
  2382. +.RS 3
  2383. +This is the name of the configuration file to check.
  2384. +.RE
  2385. +
  2386. +.I hostname
  2387. +
  2388. +.RS 3
  2389. +This is the name of the host to check access on.
  2390. +
  2391. +If this parameter is supplied, the
  2392. +.I hostIP
  2393. +parameter must also be supplied, or strange things may happen.
  2394. +.RE
  2395. +
  2396. +.I hostIP
  2397. +
  2398. +.RS 3
  2399. +This is the IP number of the host specified in the previous parameter.
  2400. +
  2401. +This number must be supplied if the
  2402. +.I hostname
  2403. +parameter is supplied, or strange things may happen.
  2404. +.RE
  2405. +.SH FILES
  2406. +.B smb.conf
  2407. +.RS 3
  2408. +This is usually the name of the configuration file used by smbd.
  2409. +.RE
  2410. +.SH ENVIRONMENT VARIABLES
  2411. +Not applicable.
  2412. +
  2413. +.SH INSTALLATION
  2414. +The location of the server and its support files is a matter for individual
  2415. +system administrators. The following are thus suggestions only.
  2416. +
  2417. +It is recommended that the
  2418. +.B testparm
  2419. +program be installed under the /usr/local hierarchy, in a directory readable
  2420. +by all, writeable only by root. The program itself should be executable by all.
  2421. +The program should NOT be setuid or setgid!
  2422. +.SH VERSION
  2423. +This man page is (mostly) correct for version 1.9.00 of the Samba suite, plus some
  2424. +of the recent patches to it. These notes will necessarily lag behind 
  2425. +development of the software, so it is possible that your version of 
  2426. +the program has extensions or parameter semantics that differ from or are not 
  2427. +covered by this man page. Please notify these to the address below for 
  2428. +rectification.
  2429. +.SH SEE ALSO
  2430. +.B smb.conf(5),
  2431. +.B smbd(8)
  2432. +.SH DIAGNOSTICS
  2433. +The program will issue a message saying whether the configuration file loaded
  2434. +OK or not. This message may be preceded by errors and warnings if the file
  2435. +did not load. If the file was loaded OK, the program then dumps all known
  2436. +service details to stdout.
  2437. +
  2438. +If a host name is specified but no host IP number, all bets are off.
  2439. +
  2440. +Other messages are self-explanatory.
  2441. +.SH BUGS
  2442. +None known.
  2443. +.SH CREDITS
  2444. +The original Samba software and related utilities were created by 
  2445. +Andrew Tridgell (samba-bugs@anu.edu.au). Andrew is also the Keeper
  2446. +of the Source for this project.
  2447. +
  2448. +The testparm program and this man page were written by Karl Auer
  2449. +(Karl.Auer@anu.edu.au)
  2450. +
  2451. +See
  2452. +.B samba(7) for a full list of contributors and details on how to 
  2453. +submit bug reports, comments etc.
  2454. diff -u -r --new-file last-version/docs/testprns.1 samba-1.9.15p5/docs/testprns.1
  2455. --- last-version/docs/testprns.1    Wed Nov 22 22:28:34 1995
  2456. +++ samba-1.9.15p5/docs/testprns.1    Sun Dec  3 18:50:56 1995
  2457. @@ -103,5 +103,6 @@
  2458.  (Karl.Auer@anu.edu.au)
  2459.  
  2460.  See
  2461. -.B samba(7) for a full list of contributors and details of how to 
  2462. +.B samba(7)
  2463. +for a full list of contributors and details of how to 
  2464.  submit bug reports, comments etc.
  2465. diff -u -r --new-file last-version/docs/testprns.1.orig samba-1.9.15p5/docs/testprns.1.orig
  2466. --- last-version/docs/testprns.1.orig    Thu Jan  1 10:00:00 1970
  2467. +++ samba-1.9.15p5/docs/testprns.1.orig    Wed Nov 22 22:28:34 1995
  2468. @@ -0,0 +1,107 @@
  2469. +.TH TESTPRNS 1 17/1/1995 testprns testprns
  2470. +.SH NAME
  2471. +testprns \- check printer name for validity with smbd
  2472. +.SH SYNOPSIS
  2473. +.B testprns
  2474. +.I printername
  2475. +[
  2476. +.I printcapname
  2477. +]
  2478. +.SH DESCRIPTION
  2479. +This program is part of the Samba suite.
  2480. +
  2481. +.B testprns
  2482. +is a very simple test program to determine whether a given 
  2483. +printer name is valid for use in a service to be provided by
  2484. +.B smbd.
  2485. +
  2486. +"Valid" in this context means "can be found in the printcap specified". This
  2487. +program is very stupid - so stupid in fact that it would be wisest to always
  2488. +specify the printcap file to use.
  2489. +.SH OPTIONS
  2490. +.I printername
  2491. +
  2492. +.RS 3
  2493. +The printer name to validate.
  2494. +
  2495. +Printer names are taken from the first field in each record in the printcap
  2496. +file, single printer names and sets of aliases separated by vertical bars
  2497. +("|") are recognised. Note that no validation or checking of the printcap
  2498. +syntax is done beyond that required to extract the printer name. It may
  2499. +be that the print spooling system is more forgiving or less forgiving
  2500. +than 
  2501. +.B testprns
  2502. +however if
  2503. +.B testprns
  2504. +finds the printer then smbd should do as well.
  2505. +
  2506. +.RE
  2507. +
  2508. +.I printcapname
  2509. +
  2510. +.RS 3
  2511. +This is the name of the printcap file to search for the given printer name
  2512. +in.
  2513. +
  2514. +If no printcap name is specified,
  2515. +.B testprns
  2516. +will attempt to scan the printcap file specified at compile time 
  2517. +(PRINTCAP_NAME).
  2518. +.RE
  2519. +.SH FILES
  2520. +.B /etc/printcap
  2521. +.RS 3
  2522. +This is usually the default printcap file to scan. See
  2523. +.B printcap(5)).
  2524. +.RE
  2525. +.SH ENVIRONMENT VARIABLES
  2526. +Not applicable.
  2527. +
  2528. +.SH INSTALLATION
  2529. +The location of the server and its support files is a matter for individual
  2530. +system administrators. The following are thus suggestions only.
  2531. +
  2532. +It is recommended that the
  2533. +.B testprns
  2534. +program be installed under the /usr/local hierarchy, in a directory readable
  2535. +by all, writeable only by root. The program should be executable by all.
  2536. +The program should NOT be setuid or setgid!
  2537. +.SH VERSION
  2538. +This man page is (mostly) correct for version 1.9.00 of the Samba suite, plus some
  2539. +of the recent patches to it. These notes will necessarily lag behind 
  2540. +development of the software, so it is possible that your version of 
  2541. +the program has extensions or parameter semantics that differ from or are not 
  2542. +covered by this man page. Please notify these to the address below for 
  2543. +rectification.
  2544. +.SH SEE ALSO
  2545. +.B printcap(5),
  2546. +.B smbd(8), 
  2547. +.B smbclient(1)
  2548. +.SH DIAGNOSTICS
  2549. +If a printer is found to be valid, the message "Printer name <printername> is 
  2550. +valid" will be displayed.
  2551. +
  2552. +If a printer is found to be invalid, the message "Printer name <printername> 
  2553. +is not valid" will be displayed.
  2554. +
  2555. +All messages that would normally be logged during operation of smbd are
  2556. +logged by this program to the file
  2557. +.I test.log
  2558. +in the current directory. The program runs at debuglevel 3, so quite extensive
  2559. +logging information is written. The log should be checked carefully for errors
  2560. +and warnings.
  2561. +
  2562. +Other messages are self-explanatory.
  2563. +.SH BUGS
  2564. +None known.
  2565. +.SH CREDITS
  2566. +The original Samba software and related utilities were created by 
  2567. +Andrew Tridgell (samba-bugs@anu.edu.au). Andrew is also the Keeper
  2568. +of the Source for this project.
  2569. +
  2570. +The testprns program and this man page were written by Karl Auer
  2571. +(Karl.Auer@anu.edu.au)
  2572. +
  2573. +See
  2574. +.B samba(7) for a full list of contributors and details of how to 
  2575. +submit bug reports, comments etc.
  2576. diff -u -r --new-file last-version/source/Makefile samba-1.9.15p5/source/Makefile
  2577. --- last-version/source/Makefile    Fri Nov 24 00:42:24 1995
  2578. +++ samba-1.9.15p5/source/Makefile    Sun Dec  3 18:57:00 1995
  2579. @@ -117,7 +117,7 @@
  2580.  #                           remotely (only works on some systems)
  2581.  #   -DQUOTAS for quota support in disk_free(). This probably only works 
  2582.  #            on some systems.
  2583. -#                            
  2584. +#
  2585.  #    NOTE: GETPWANAM & PWDAUTH are mutually exclusive, if you
  2586.  #          Define one, you should NOT define the other.
  2587.  #####################################
  2588. @@ -426,8 +426,8 @@
  2589.  LIBS = $(LIBS1) $(LIBSM) $(DCE_LIBS) $(DES_LIB)
  2590.  
  2591.  PROGS1 = smbd smbclient nmbd testparm testprns smbrun smbstatus smbpasswd 
  2592. -PROGS = $(PROGS1) nmblookup addtosmbpass
  2593. -SCRIPTS = smbtar
  2594. +PROGS = $(PROGS1) nmblookup
  2595. +SCRIPTS = smbtar addtosmbpass
  2596.  
  2597.  all : CHECK $(PROGS)
  2598.  
  2599. diff -u -r --new-file last-version/source/change-log samba-1.9.15p5/source/change-log
  2600. --- last-version/source/change-log    Fri Nov 24 23:20:15 1995
  2601. +++ samba-1.9.15p5/source/change-log    Sun Dec  3 21:56:45 1995
  2602. @@ -1663,7 +1663,7 @@
  2603.      - updated INSTALL.txt
  2604.      - hopefully fixed server level security with WfWg
  2605.  
  2606. -2.0.0:
  2607. +1.9.15 (patches):
  2608.          - major/minor fix for solaris from Jeroen Schipper 
  2609.      <Jeroen.Schipper@let.ruu.nl>
  2610.      - fixed critical bug in directory listings
  2611. @@ -1702,11 +1702,32 @@
  2612.      - kanji patches from fujita@ainix.isac.co.jp (Takashi Fujita)
  2613.      - fixed bug handling non-encrypted passwords
  2614.      - released p4
  2615. -
  2616. -
  2617. +    - fixed makefile for addtosmbpass
  2618. +    - DCE/DFS fixes from John Brezak (brezak@ch.hp.com)
  2619. +    - client patch for partial command matching from Andrew Wiseman 
  2620. +    <bandc@dircon.co.uk>
  2621. +    - made is_8_3() handle full paths
  2622. +    - rewrote open_file_shared() with help from Charles Hoch 
  2623. +    <hoch@hplcgh.hpl.hp.com>
  2624. +    - changed syslog to handle interactive programs
  2625. +    - fixed syslog problem with full path in argv[0]
  2626. +    - illegal name fixup for kanji from fujita@ainix.isac.co.jp
  2627. +    - fixed server level security to allow fallback to encryption
  2628. +    - changed reply_read() and reply_lockread() to ignore clients 
  2629. +    smb_bufsize in order to    handle broken lanman clients
  2630. +    - fixed NT wildcard problem with old style programs
  2631. +    - man page patches from "John M. Sellens" 
  2632. +    <jmsellen@watdragon.uwaterloo.ca>
  2633. +    - partially documented the "character set" option
  2634. +    - changed default for MAXDIR to 64
  2635. +    - changed default DPTR idle time to 120
  2636. +    
  2637. +    
  2638.  ==========
  2639.  todo:
  2640.  
  2641. +leftover lock files can end up belonging to non-smbd processes after a reboot.
  2642. +    
  2643.  hosts allow in nmbd
  2644.  
  2645.  hosts allow cache
  2646. @@ -1724,20 +1745,15 @@
  2647.  add option to print more info about locked files (full path, share name
  2648.  etc)
  2649.  
  2650. -add masking to opendir?
  2651. -
  2652. -no refresh/reg of new IP? or send wack and challenge owner?
  2653. +very slow listing CD, perhaps because of order of stat and readdir or add 
  2654. +masking to opendir?
  2655.  
  2656.  protocol drop back in client to avoid openX etc.
  2657.  
  2658. -very slow listing CD, perhaps because of order of stat and readdir?
  2659. -
  2660.  handle exported fat drives to a long filename capable client
  2661.  
  2662.  add check for existance of lpq commands etc (use stat?)
  2663.  
  2664. -example showing popup on login containing "quota -v"
  2665. -
  2666.  get rid of the silly +4 and -4 by removing NBT stuff
  2667.  
  2668.  write-only shares
  2669. @@ -1748,18 +1764,17 @@
  2670.  
  2671.  document homes behaviour with WinDD
  2672.  
  2673. -apparently WfWg doesn't like the password server stuff in 1.9.14. Why?
  2674. -
  2675.  add "hide file = *.o" "hide dir = .Foo*" "show file = xx*" type options.
  2676.  
  2677.  ALLOW_PASSWORD_CHANGE only compiles/works on some systems
  2678.  
  2679.  weird foooooooo/open.exe bug on NT
  2680.  
  2681. -%a detection can't detect Win95
  2682. -
  2683. -lpd stuff:
  2684. - Tony Aiuto  (tony@ics.com)
  2685. -
  2686. +%a detection can't detect Win95 versus WinNT
  2687.  
  2688. +reverse mangled maps, so (*.html *.htm) works for new files.
  2689.  
  2690. +install problems with w95. could be some sort of race?
  2691. +    
  2692. +lpd stuff:
  2693. +     Tony Aiuto (tony@ics.com)
  2694. diff -u -r --new-file last-version/source/charset.c samba-1.9.15p5/source/charset.c
  2695. --- last-version/source/charset.c    Thu Jun 29 18:17:35 1995
  2696. +++ samba-1.9.15p5/source/charset.c    Sun Dec  3 19:26:29 1995
  2697. @@ -54,7 +54,7 @@
  2698.    upper_char_map = &xx_upper_char_map[128];
  2699.    lower_char_map = &xx_lower_char_map[128];
  2700.  
  2701. -  for (i=-128;i<=127;i++) {
  2702. +  for (i= -128;i<=127;i++) {
  2703.      dos_char_map[(char)i] = 0;
  2704.    }
  2705.  
  2706. @@ -63,7 +63,7 @@
  2707.        add_dos_char(i,0);
  2708.    }
  2709.  
  2710. -  for (i=-128;i<=127;i++) {
  2711. +  for (i= -128;i<=127;i++) {
  2712.      char c = (char)i;
  2713.      upper_char_map[i] = lower_char_map[i] = c;
  2714.      if (isupper(c)) lower_char_map[c] = tolower(c);
  2715. diff -u -r --new-file last-version/source/chgpasswd.c samba-1.9.15p5/source/chgpasswd.c
  2716. --- last-version/source/chgpasswd.c    Tue Jul 11 18:12:10 1995
  2717. +++ samba-1.9.15p5/source/chgpasswd.c    Wed Nov 29 11:34:05 1995
  2718. @@ -18,6 +18,14 @@
  2719.   * using it for any other reason are granted, so long as this disclaimer is left intact.
  2720.   */
  2721.  
  2722. +/*
  2723. +   This code was hacked considerably for inclusion in Samba, primarily
  2724. +   by Andrew.Tridgell@anu.edu.au. The biggest change was the addition
  2725. +   of the "password chat" option, which allows the easy runtime
  2726. +   specification of the expected sequence of events to change a
  2727. +   password.
  2728. +   */
  2729. +
  2730.  #include "includes.h"
  2731.  #include "loadparm.h"
  2732.  
  2733. diff -u -r --new-file last-version/source/client.c samba-1.9.15p5/source/client.c
  2734. --- last-version/source/client.c    Thu Nov 23 11:13:47 1995
  2735. +++ samba-1.9.15p5/source/client.c    Sun Dec  3 16:41:44 1995
  2736. @@ -36,6 +36,7 @@
  2737.  pstring myname = "";
  2738.  pstring password = "";
  2739.  pstring username="";
  2740. +pstring workgroup=WORKGROUP;
  2741.  BOOL got_pass = False;
  2742.  BOOL connect_as_printer = False;
  2743.  BOOL connect_as_ipc = False;
  2744. @@ -49,6 +50,9 @@
  2745.  #define CLIENT_TIMEOUT (30*1000)
  2746.  #define SHORT_TIMEOUT (5*1000)
  2747.  
  2748. +/* value for unused fid field in trans2 secondary request */
  2749. +#define FID_UNUSED (0xFFFF)
  2750. +
  2751.  int name_type = 0x20;
  2752.  
  2753.  int max_protocol = PROTOCOL_NT1;
  2754. @@ -146,6 +150,11 @@
  2755.  static BOOL call_api(int prcnt,int drcnt,int mprcnt,int mdrcnt,
  2756.               int *rprcnt,int *rdrcnt,char *param,char *data,
  2757.               char **rparam,char **rdata);
  2758. +static BOOL send_trans_request(char *outbuf,int trans,
  2759. +                   char *name,int fid,int flags,
  2760. +                   char *data,char *param,uint16 *setup,
  2761. +                   int ldata,int lparam,int lsetup,
  2762. +                   int mdata,int mparam,int msetup);
  2763.  
  2764.  
  2765.  /****************************************************************************
  2766. @@ -158,7 +167,7 @@
  2767.    SSVAL(outbuf,smb_mid,mid);
  2768.    if (Protocol > PROTOCOL_CORE)
  2769.      {
  2770. -      CVAL(outbuf,smb_flg) = 0x8;
  2771. +      SCVAL(outbuf,smb_flg,0x8);
  2772.        SSVAL(outbuf,smb_flg2,0x1);
  2773.      }
  2774.  }
  2775. @@ -257,7 +266,7 @@
  2776.  
  2777.    bzero(outbuf,smb_size);
  2778.    set_message(outbuf,0,4 + strlen(path2),True);
  2779. -  CVAL(outbuf,smb_com) = SMBchkpth;
  2780. +  SCVAL(outbuf,smb_com,SMBchkpth);
  2781.    SSVAL(outbuf,smb_tid,cnum);
  2782.    setup_pkt(outbuf);
  2783.  
  2784. @@ -800,18 +809,28 @@
  2785.  }
  2786.  
  2787.  /****************************************************************************
  2788. -  receive a SMB trans2 response allocating the necessary memory
  2789. +  receive a SMB trans or trans2 response allocating the necessary memory
  2790.    ****************************************************************************/
  2791. -static BOOL receive_trans2_response(char *inbuf,int *data_len,int *param_len,
  2792. +static BOOL receive_trans_response(char *inbuf,int trans,
  2793. +                                   int *data_len,int *param_len,
  2794.                        char **data,char **param)
  2795.  {
  2796.    int total_data=0;
  2797.    int total_param=0;
  2798. +  int this_data,this_param;
  2799.  
  2800.    *data_len = *param_len = 0;
  2801.  
  2802.    receive_smb(Client,inbuf,CLIENT_TIMEOUT);
  2803. +  show_msg(inbuf);
  2804.  
  2805. +  /* sanity check */
  2806. +  if (CVAL(inbuf,smb_com) != trans)
  2807. +    {
  2808. +      DEBUG(0,("Expected %s response, got command 0x%02x\n",
  2809. +           trans==SMBtrans?"SMBtrans":"SMBtrans2", CVAL(inbuf,smb_com)));
  2810. +      return(False);
  2811. +    }
  2812.    if (CVAL(inbuf,smb_rcls) != 0)
  2813.      return(False);
  2814.  
  2815. @@ -825,12 +844,18 @@
  2816.  
  2817.    while (1)
  2818.      {
  2819. -      memcpy(*data + SVAL(inbuf,smb_drdisp),smb_base(inbuf) + SVAL(inbuf,smb_droff),
  2820. -         SVAL(inbuf,smb_drcnt));
  2821. -      memcpy(*param + SVAL(inbuf,smb_prdisp),smb_base(inbuf) + SVAL(inbuf,smb_proff),
  2822. -         SVAL(inbuf,smb_prcnt));
  2823. -      *data_len += SVAL(inbuf,smb_drcnt);
  2824. -      *param_len += SVAL(inbuf,smb_prcnt);
  2825. +      this_data = SVAL(inbuf,smb_drcnt);
  2826. +      this_param = SVAL(inbuf,smb_prcnt);
  2827. +      if (this_data)
  2828. +    memcpy(*data + SVAL(inbuf,smb_drdisp),
  2829. +           smb_base(inbuf) + SVAL(inbuf,smb_droff),
  2830. +           this_data);
  2831. +      if (this_param)
  2832. +    memcpy(*param + SVAL(inbuf,smb_prdisp),
  2833. +           smb_base(inbuf) + SVAL(inbuf,smb_proff),
  2834. +           this_param);
  2835. +      *data_len += this_data;
  2836. +      *param_len += this_param;
  2837.  
  2838.        /* parse out the total lengths again - they can shrink! */
  2839.        total_data = SVAL(inbuf,smb_tdrcnt);
  2840. @@ -838,7 +863,19 @@
  2841.  
  2842.        if (total_data <= *data_len && total_param <= *param_len)
  2843.      break;
  2844. +
  2845.        receive_smb(Client,inbuf,CLIENT_TIMEOUT);
  2846. +      show_msg(inbuf);
  2847. +
  2848. +      /* sanity check */
  2849. +      if (CVAL(inbuf,smb_com) != trans)
  2850. +    {
  2851. +      DEBUG(0,("Expected %s response, got command 0x%02x\n",
  2852. +           trans==SMBtrans?"SMBtrans":"SMBtrans2", CVAL(inbuf,smb_com)));
  2853. +      return(False);
  2854. +    }
  2855. +      if (CVAL(inbuf,smb_rcls) != 0)
  2856. +      return(False);
  2857.      }
  2858.    
  2859.    return(True);
  2860. @@ -872,6 +909,9 @@
  2861.    int ff_dir_handle=0;
  2862.    int loop_count = 0;
  2863.  
  2864. +  uint16 setup;
  2865. +  pstring param;
  2866. +
  2867.    strcpy(mask,Mask);
  2868.  
  2869.    while (ff_eos == 0)
  2870. @@ -883,67 +923,39 @@
  2871.        break;
  2872.      }
  2873.  
  2874. -      bzero(outbuf,smb_setup);
  2875. -      set_message(outbuf,15,5 + 12 + strlen(mask)+1,True);
  2876. -      CVAL(outbuf,smb_com) = SMBtrans2;
  2877. -      SSVAL(outbuf,smb_tid,cnum);
  2878. -      setup_pkt(outbuf);
  2879. -  
  2880. -      SSVAL(outbuf,smb_tpscnt,12 + strlen(mask)+1);
  2881. -      SSVAL(outbuf,smb_tdscnt,0);
  2882. -      SSVAL(outbuf,smb_mprcnt,10); 
  2883. -      SSVAL(outbuf,smb_mdrcnt,0xFFFF);
  2884. -      SSVAL(outbuf,smb_msrcnt,0);
  2885. -      SSVAL(outbuf,smb_flags,0); 
  2886. -      SIVAL(outbuf,smb_timeout,0);
  2887. -      SSVAL(outbuf,smb_pscnt,SVAL(outbuf,smb_tpscnt));
  2888. -      SSVAL(outbuf,smb_psoff,smb_offset(smb_buf(outbuf)+3,outbuf));
  2889. -      SSVAL(outbuf,smb_dscnt,0);
  2890. -      SSVAL(outbuf,smb_dsoff,0);
  2891. -      SSVAL(outbuf,smb_suwcnt,1);
  2892. -
  2893. -      if (First)
  2894. -    SSVAL(outbuf,smb_setup0,TRANSACT2_FINDFIRST);
  2895. -      else
  2896. -    SSVAL(outbuf,smb_setup0,TRANSACT2_FINDNEXT);
  2897. -
  2898. -      p = smb_buf(outbuf);
  2899. -      *p++ = 0;            /* put in a null smb_name */
  2900. -      *p++ = 'D'; *p++ = ' ';    /* this was added because OS/2 does it */
  2901. -
  2902.        if (First)
  2903.      {
  2904. -      SSVAL(p,0,attribute); /* attribute */
  2905. -      SSVAL(p,2,max_matches); /* max count */
  2906. -      SSVAL(p,4,8+4+2);    /* resume required + close on end + continue */
  2907. -      SSVAL(p,6,info_level); 
  2908. -      SIVAL(p,8,0);
  2909. -      p += 12;
  2910. -      strcpy(p,mask);
  2911. -      p += strlen(mask);
  2912. -      *p++ = 0; *p++ = 0;
  2913. +      setup = TRANSACT2_FINDFIRST;
  2914. +      SSVAL(param,0,attribute); /* attribute */
  2915. +      SSVAL(param,2,max_matches); /* max count */
  2916. +      SSVAL(param,4,8+4+2);    /* resume required + close on end + continue */
  2917. +      SSVAL(param,6,info_level); 
  2918. +      SIVAL(param,8,0);
  2919. +      strcpy(param+12,mask);
  2920.      }
  2921.        else
  2922.      {
  2923. +      setup = TRANSACT2_FINDNEXT;
  2924. +      SSVAL(param,0,ff_dir_handle);
  2925. +      SSVAL(param,2,max_matches); /* max count */
  2926. +      SSVAL(param,4,info_level); 
  2927. +      SIVAL(param,6,ff_resume_key); /* ff_resume_key */
  2928. +      SSVAL(param,10,8+4+2);    /* resume required + close on end + continue */
  2929. +      strcpy(param+12,mask);
  2930. +
  2931.        DEBUG(5,("hand=0x%X resume=%d ff_lastname=%d mask=%s\n",
  2932.             ff_dir_handle,ff_resume_key,ff_lastname,mask));
  2933. -      SSVAL(p,0,ff_dir_handle);
  2934. -      SSVAL(p,2,max_matches); /* max count */
  2935. -      SSVAL(p,4,info_level); 
  2936. -      SIVAL(p,6,ff_resume_key); /* ff_resume_key */
  2937. -      SSVAL(p,10,8+4+2);    /* resume required + close on end + continue */
  2938. -      p += 12;
  2939. -      strcpy(p,mask);
  2940. -      *p++ = 0; *p++ = 0;
  2941.      }
  2942. +      /* ??? original code added 1 pad byte after param */
  2943.  
  2944. -      send_smb(Client,outbuf);
  2945. +      send_trans_request(outbuf,SMBtrans2,NULL,FID_UNUSED,0,
  2946. +             NULL,param,&setup,
  2947. +             0,12+strlen(mask)+1,1,
  2948. +             BUFFER_SIZE,10,0);
  2949.  
  2950. -      receive_trans2_response(inbuf,
  2951. +      if (!receive_trans_response(inbuf,SMBtrans2,
  2952.                    &resp_data_len,&resp_param_len,
  2953. -                  &resp_data,&resp_param);
  2954. -
  2955. -      if (CVAL(inbuf,smb_rcls) != 0)
  2956. +                      &resp_data,&resp_param))
  2957.      {
  2958.        DEBUG(3,("FIND%s gave %s\n",First?"FIRST":"NEXT",smb_errstr(inbuf)));
  2959.        break;
  2960. @@ -1144,7 +1156,7 @@
  2961.        SSVAL(p,smb_wct,10);
  2962.        SSVAL(p,smb_vwv0,0xFF);
  2963.        SSVAL(p,smb_vwv5,MIN(max_xmit-500,finfo.size));
  2964. -      SSVAL(p,smb_vwv9,MIN(0xFFFF,finfo.size));
  2965. +      SSVAL(p,smb_vwv9,MIN(BUFFER_SIZE,finfo.size));
  2966.        smb_setlen(outbuf,smb_len(outbuf)+11*2+1);  
  2967.      }
  2968.  #endif
  2969. @@ -1275,7 +1287,7 @@
  2970.        SSVAL(outbuf,smb_vwv5,MIN(max_xmit-200,finfo.size - nread));
  2971.        SSVAL(outbuf,smb_vwv6,0);
  2972.        SIVAL(outbuf,smb_vwv7,0);
  2973. -      SSVAL(outbuf,smb_vwv9,MIN(0xFFFF,finfo.size-nread));
  2974. +      SSVAL(outbuf,smb_vwv9,MIN(BUFFER_SIZE,finfo.size-nread));
  2975.        
  2976.        if (close_done)
  2977.          {
  2978. @@ -1317,7 +1329,7 @@
  2979.        /* use readbraw */
  2980.      case 1:
  2981.        {
  2982. -        static int readbraw_size = 0xFFFF;
  2983. +        static int readbraw_size = BUFFER_SIZE;
  2984.        
  2985.          extern int Client;
  2986.          bzero(outbuf,smb_size);
  2987. @@ -1905,7 +1917,7 @@
  2988.    DEBUG(1,("putting file %s of size %d bytes as %s ",lname,finfo->size,CNV_LANG(rname)));
  2989.    
  2990.    if (!maxwrite)
  2991. -    maxwrite = writebraw_supported?MAX(max_xmit,0xFFFF):(max_xmit-200);
  2992. +    maxwrite = writebraw_supported?MAX(max_xmit,BUFFER_SIZE):(max_xmit-200);
  2993.  
  2994.    while (nread < finfo->size)
  2995.      {
  2996. @@ -2152,7 +2164,9 @@
  2997.    ****************************************************************************/
  2998.  static void do_cancel(int job)
  2999.  {
  3000. -  char *p,*rparam,*rdata;
  3001. +  char *rparam = NULL;
  3002. +  char *rdata = NULL;
  3003. +  char *p;
  3004.    int rdrcnt,rprcnt;
  3005.    pstring param;
  3006.  
  3007. @@ -2182,8 +2196,12 @@
  3008.      printf("Error %d calcelling job %d\n",res,job);
  3009.        return;
  3010.      }
  3011. -
  3012. +  else
  3013.    printf("Server refused cancel request\n");
  3014. +
  3015. +  if (rparam) free(rparam);
  3016. +  if (rdata) free(rdata);
  3017. +
  3018.    return;
  3019.  }
  3020.  
  3021. @@ -2219,54 +2237,31 @@
  3022.  static void cmd_stat(char *inbuf,char *outbuf)
  3023.  {
  3024.    fstring buf;
  3025. -  pstring fname;
  3026. +  pstring param;
  3027.    char *resp_data=NULL;
  3028.    char *resp_param=NULL;
  3029.    int resp_data_len = 0;
  3030.    int resp_param_len=0;
  3031.    char *p;
  3032. +  uint16 setup = TRANSACT2_QPATHINFO;
  3033.  
  3034.    if (!next_token(NULL,buf,NULL)) {
  3035.      printf("stat <file>\n");
  3036.      return;
  3037.    }
  3038.  
  3039. -  strcpy(fname,cur_dir);
  3040. -  strcat(fname,buf);
  3041. -
  3042. -  bzero(outbuf,smb_setup);
  3043. -  set_message(outbuf,15,5 + 6 + strlen(fname)+1,True);
  3044. -  CVAL(outbuf,smb_com) = SMBtrans2;
  3045. -  SSVAL(outbuf,smb_tid,cnum);
  3046. -  setup_pkt(outbuf);
  3047. -  
  3048. -  SSVAL(outbuf,smb_tpscnt,6 + strlen(fname)+1);
  3049. -  SSVAL(outbuf,smb_tdscnt,0);
  3050. -  SSVAL(outbuf,smb_mprcnt,2); 
  3051. -  SSVAL(outbuf,smb_mdrcnt,65535);
  3052. -  SSVAL(outbuf,smb_msrcnt,0);
  3053. -  SSVAL(outbuf,smb_flags,0); 
  3054. -  SIVAL(outbuf,smb_timeout,0);
  3055. -  SSVAL(outbuf,smb_pscnt,SVAL(outbuf,smb_tpscnt));
  3056. -  SSVAL(outbuf,smb_psoff,smb_offset(smb_buf(outbuf)+3,outbuf));
  3057. -  SSVAL(outbuf,smb_dscnt,0);
  3058. -  SSVAL(outbuf,smb_dsoff,0);
  3059. -  SSVAL(outbuf,smb_suwcnt,1);
  3060. -
  3061. -  SSVAL(outbuf,smb_setup0,TRANSACT2_QPATHINFO);
  3062. -
  3063. -  p = smb_buf(outbuf);
  3064. -  *p++ = 0;            /* put in a null smb_name */
  3065. -  *p++ = 'D'; *p++ = ' ';    /* this was added because OS/2 does it */
  3066. -
  3067. -  SSVAL(p,0,4); /* level */
  3068. -  p += 6;
  3069. -  strcpy(p,fname);
  3070. -  p = skip_string(p,1);
  3071. -
  3072. -  send_smb(Client,outbuf);
  3073. +  bzero(param,6);
  3074. +  SSVAL(param,0,4); /* level */
  3075. +  p = param+6;
  3076. +  strcpy(p,cur_dir);
  3077. +  strcat(p,buf);
  3078. +
  3079. +  send_trans_request(outbuf,SMBtrans2,NULL,FID_UNUSED,0,
  3080. +             NULL,param,&setup,
  3081. +             0,6 + strlen(p)+1,1,
  3082. +             BUFFER_SIZE,2,0);
  3083.  
  3084. -  receive_trans2_response(inbuf,
  3085. +  receive_trans_response(inbuf,SMBtrans2,
  3086.                &resp_data_len,&resp_param_len,
  3087.                &resp_data,&resp_param);
  3088.  
  3089. @@ -3095,7 +3090,7 @@
  3090.      p = smb_buf(outbuf);
  3091.      memcpy(p,pword,passlen); p += SVAL(outbuf,smb_vwv7);
  3092.      strcpy(p,username);p = skip_string(p,1);
  3093. -    strcpy(p,WORKGROUP);p = skip_string(p,1);
  3094. +    strcpy(p,workgroup);p = skip_string(p,1);
  3095.      strcpy(p,"Unix");p = skip_string(p,1);
  3096.      strcpy(p,"Samba");p = skip_string(p,1);
  3097.      set_message(outbuf,13,PTR_DIFF(p,smb_buf(outbuf)),False);
  3098. @@ -3279,69 +3274,150 @@
  3099.  {
  3100.    static char *inbuf=NULL;
  3101.    static char *outbuf=NULL;
  3102. -  char *p1,*p2;
  3103.  
  3104.    if (!inbuf) inbuf = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN);
  3105.    if (!outbuf) outbuf = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN);
  3106.  
  3107. -  /* send a SMBtrans command */
  3108. +  send_trans_request(outbuf,SMBtrans,"\\PIPE\\LANMAN",0,0,
  3109. +             data,param,NULL,
  3110. +             drcnt,prcnt,0,
  3111. +             mdrcnt,mprcnt,0);
  3112. +
  3113. +  return (receive_trans_response(inbuf,SMBtrans,
  3114. +                                 rdrcnt,rprcnt,
  3115. +                                 rdata,rparam));
  3116. +}
  3117. +
  3118. +/****************************************************************************
  3119. +  send a SMB trans or trans2 request
  3120. +  ****************************************************************************/
  3121. +static BOOL send_trans_request(char *outbuf,int trans,
  3122. +                   char *name,int fid,int flags,
  3123. +                   char *data,char *param,uint16 *setup,
  3124. +                   int ldata,int lparam,int lsetup,
  3125. +                   int mdata,int mparam,int msetup)
  3126. +{
  3127. +  int i;
  3128. +  int this_ldata,this_lparam;
  3129. +  int tot_data=0,tot_param=0;
  3130. +  char *outdata,*outparam;
  3131. +  pstring inbuf;
  3132. +  char *p;
  3133. +
  3134. +  this_lparam = MIN(lparam,max_xmit - (500+lsetup*SIZEOFWORD)); /* hack */
  3135. +  this_ldata = MIN(ldata,max_xmit - (500+lsetup*SIZEOFWORD+this_lparam));
  3136. +
  3137.    bzero(outbuf,smb_size);
  3138. -  set_message(outbuf,14,0,True);
  3139. -  CVAL(outbuf,smb_com) = SMBtrans;
  3140. +  set_message(outbuf,14+lsetup,0,True);
  3141. +  CVAL(outbuf,smb_com) = trans;
  3142.    SSVAL(outbuf,smb_tid,cnum);
  3143.    setup_pkt(outbuf);
  3144.  
  3145. -  p1 = smb_buf(outbuf);
  3146. -  strcpy(p1,"\\PIPE\\LANMAN");
  3147. -  p1 = skip_string(p1,1);
  3148. -  p2 = p1 + prcnt;
  3149. -
  3150. -  if (prcnt > 0)
  3151. -    memcpy(p1,param,prcnt);
  3152. -  if (drcnt > 0)
  3153. -    memcpy(p2,data,drcnt);
  3154. -
  3155. -  SSVAL(outbuf,smb_vwv0,prcnt); /* param count */
  3156. -  SSVAL(outbuf,smb_vwv1,drcnt); /* data count */
  3157. -  SSVAL(outbuf,smb_vwv2,mprcnt); /* mprcnt */
  3158. -  SSVAL(outbuf,smb_vwv3,mdrcnt); /* mdrcnt */
  3159. -  SSVAL(outbuf,smb_vwv4,0); /* msrcnt */
  3160. -  SSVAL(outbuf,smb_vwv5,0); /* flags */
  3161. -  SSVAL(outbuf,smb_vwv9,prcnt); /* pscnt */
  3162. -  SSVAL(outbuf,smb_vwv10,smb_offset(p1,outbuf)); /* psoff */
  3163. -  SSVAL(outbuf,smb_vwv11,drcnt); /* dscnt */
  3164. -  SSVAL(outbuf,smb_vwv12,smb_offset(p2,outbuf)); /* dsoff */
  3165. -  CVAL(outbuf,smb_vwv13) = 0; /* suwcnt */
  3166. +  outparam = smb_buf(outbuf)+(trans==SMBtrans ? strlen(name)+1 : 3);
  3167. +  outdata = outparam+this_lparam;
  3168.  
  3169. -  set_message(outbuf,14,PTR_DIFF(p2+drcnt,smb_buf(outbuf)),False);
  3170. +  /* primary request */
  3171. +  SSVAL(outbuf,smb_tpscnt,lparam);    /* tpscnt */
  3172. +  SSVAL(outbuf,smb_tdscnt,ldata);    /* tdscnt */
  3173. +  SSVAL(outbuf,smb_mprcnt,mparam);    /* mprcnt */
  3174. +  SSVAL(outbuf,smb_mdrcnt,mdata);    /* mdrcnt */
  3175. +  SCVAL(outbuf,smb_msrcnt,msetup);    /* msrcnt */
  3176. +  SSVAL(outbuf,smb_flags,flags);    /* flags */
  3177. +  SIVAL(outbuf,smb_timeout,0);        /* timeout */
  3178. +  SSVAL(outbuf,smb_pscnt,this_lparam);    /* pscnt */
  3179. +  SSVAL(outbuf,smb_psoff,smb_offset(outparam,outbuf)); /* psoff */
  3180. +  SSVAL(outbuf,smb_dscnt,this_ldata);    /* dscnt */
  3181. +  SSVAL(outbuf,smb_dsoff,smb_offset(outdata,outbuf)); /* dsoff */
  3182. +  SCVAL(outbuf,smb_suwcnt,lsetup);    /* suwcnt */
  3183. +  for (i=0;i<lsetup;i++)        /* setup[] */
  3184. +    SSVAL(outbuf,smb_setup+i*SIZEOFWORD,setup[i]);
  3185. +  p = smb_buf(outbuf);
  3186. +  if (trans==SMBtrans)
  3187. +    strcpy(p,name);            /* name[] */
  3188. +  else
  3189. +    {
  3190. +      *p++ = 0;                /* put in a null smb_name */
  3191. +      *p++ = 'D'; *p++ = ' ';        /* this was added because OS/2 does it */
  3192. +    }
  3193. +  if (this_lparam)            /* param[] */
  3194. +    memcpy(outparam,param,this_lparam);
  3195. +  if (this_ldata)            /* data[] */
  3196. +    memcpy(outdata,data,this_ldata);
  3197. +  set_message(outbuf,14+lsetup,        /* wcnt, bcc */
  3198. +          PTR_DIFF(outdata+this_ldata,smb_buf(outbuf)),False);
  3199.  
  3200. +  show_msg(outbuf);
  3201.    send_smb(Client,outbuf);
  3202. -  receive_smb(Client,inbuf,CLIENT_TIMEOUT);
  3203. +
  3204. +  if (this_ldata < ldata || this_lparam < lparam)
  3205. +    {
  3206. +      /* receive interim response */
  3207. +      if (!receive_smb(Client,inbuf,SHORT_TIMEOUT) || CVAL(inbuf,smb_rcls) != 0)
  3208. +    {
  3209. +      DEBUG(0,("%s request failed (%s)\n",
  3210. +               trans==SMBtrans?"SMBtrans":"SMBtrans2", smb_errstr(inbuf)));
  3211. +      return(False);
  3212. +    }      
  3213. +
  3214. +      tot_data = this_ldata;
  3215. +      tot_param = this_lparam;
  3216.  
  3217. -  if (CVAL(inbuf,smb_rcls) == 0)
  3218. +      while (tot_data < ldata || tot_param < lparam)
  3219.      {
  3220. -      if (rparam)
  3221. -    *rparam = inbuf+4 + SVAL(inbuf,smb_vwv4);
  3222. -      if (rdata)
  3223. -    *rdata = inbuf+4 + SVAL(inbuf,smb_vwv7);
  3224. -      if (rprcnt)
  3225. -    *rprcnt = SVAL(inbuf,smb_vwv3);
  3226. -      if (rdrcnt)
  3227. -    *rdrcnt = SVAL(inbuf,smb_vwv6);
  3228. -      return(True);
  3229. +      this_lparam = MIN(lparam-tot_param,max_xmit - 500); /* hack */
  3230. +      this_ldata = MIN(ldata-tot_data,max_xmit - (500+this_lparam));
  3231. +
  3232. +      set_message(outbuf,trans==SMBtrans?8:9,0,True);
  3233. +      CVAL(outbuf,smb_com) = trans==SMBtrans ? SMBtranss : SMBtranss2;
  3234. +
  3235. +      outparam = smb_buf(outbuf);
  3236. +      outdata = outparam+this_lparam;
  3237. +
  3238. +      /* secondary request */
  3239. +      SSVAL(outbuf,smb_tpscnt,lparam);    /* tpscnt */
  3240. +      SSVAL(outbuf,smb_tdscnt,ldata);    /* tdscnt */
  3241. +      SSVAL(outbuf,smb_spscnt,this_lparam);    /* pscnt */
  3242. +      SSVAL(outbuf,smb_spsoff,smb_offset(outparam,outbuf)); /* psoff */
  3243. +      SSVAL(outbuf,smb_spsdisp,tot_param);    /* psdisp */
  3244. +      SSVAL(outbuf,smb_sdscnt,this_ldata);    /* dscnt */
  3245. +      SSVAL(outbuf,smb_sdsoff,smb_offset(outdata,outbuf)); /* dsoff */
  3246. +      SSVAL(outbuf,smb_sdsdisp,tot_data);    /* dsdisp */
  3247. +      if (trans==SMBtrans2)
  3248. +        SSVAL(outbuf,smb_sfid,fid);        /* fid */
  3249. +      if (this_lparam)            /* param[] */
  3250. +        memcpy(outparam,param,this_lparam);
  3251. +      if (this_ldata)            /* data[] */
  3252. +        memcpy(outdata,data,this_ldata);
  3253. +      set_message(outbuf,trans==SMBtrans?8:9, /* wcnt, bcc */
  3254. +              PTR_DIFF(outdata+this_ldata,smb_buf(outbuf)),False);
  3255. +
  3256. +      show_msg(outbuf);
  3257. +      send_smb(Client,outbuf);
  3258. +
  3259. +      tot_data += this_ldata;
  3260. +      tot_param += this_lparam;
  3261. +    }
  3262.      }
  3263.  
  3264. -  return(False);
  3265. +    return(True);
  3266.  }
  3267.  
  3268. -
  3269.  /****************************************************************************
  3270.  try and browse available connections on a host
  3271.  ****************************************************************************/
  3272. -static BOOL browse_host()
  3273. +static BOOL browse_host(BOOL sort)
  3274.  {
  3275. -  char *p,*rparam,*rdata;
  3276. +#ifdef NOSTRCASECMP
  3277. +#define strcasecmp StrCaseCmp
  3278. +#endif
  3279. +  extern int strcasecmp();
  3280. +
  3281. +  char *rparam = NULL;
  3282. +  char *rdata = NULL;
  3283. +  char *p;
  3284. +  int rdrcnt,rprcnt;
  3285.    pstring param;
  3286. +  int count = -1;
  3287.  
  3288.    /* now send a SMBtrans command with api RNetShareEnum */
  3289.    p = param;
  3290. @@ -3352,68 +3428,73 @@
  3291.    strcpy(p,"B13BWz");
  3292.    p = skip_string(p,1);
  3293.    SSVAL(p,0,1);
  3294. -  SSVAL(p,2,10000);
  3295. +  SSVAL(p,2,BUFFER_SIZE);
  3296.    p += 4;
  3297.  
  3298.    if (call_api(PTR_DIFF(p,param),0,
  3299. -           1024,10000,
  3300. -           NULL,NULL,
  3301. +           1024,BUFFER_SIZE,
  3302. +               &rprcnt,&rdrcnt,
  3303.             param,NULL,
  3304.             &rparam,&rdata))
  3305.      {
  3306.        int res = SVAL(rparam,0);
  3307.        int converter=SVAL(rparam,2);
  3308. -      int count=SVAL(rparam,4);
  3309.        int i;
  3310.        BOOL long_share_name=False;
  3311. -
  3312. -      if (res != 0)
  3313. -    return(False);
  3314. -
  3315. -      p = rdata;
  3316. -
  3317. -      if (count > 0)
  3318. -    {
  3319. -      printf("\n\tSharename      Type      Comment\n");
  3320. -      printf("\t---------      ----      -------\n");
  3321. -    }
  3322. -
  3323. -      for (i=0;i<count;i++)
  3324. +      
  3325. +      if (res == 0)
  3326.      {
  3327. -      char *sname = p;
  3328. -      int type = SVAL(p,14);
  3329. -      int comment_offset = IVAL(p,16) & 0xFFFF;
  3330. -      fstring typestr="";
  3331. +      count=SVAL(rparam,4);
  3332. +      p = rdata;
  3333.  
  3334. -      switch (type)
  3335. +      if (count > 0)
  3336.          {
  3337. -        case 0:
  3338. -          strcpy(typestr,"Disk"); break;
  3339. -        case 1:
  3340. -          strcpy(typestr,"Printer"); break;          
  3341. -        case 2:
  3342. -          strcpy(typestr,"Device"); break;
  3343. -        case 3:
  3344. -          strcpy(typestr,"IPC"); break;      
  3345. +          printf("\n\tSharename      Type      Comment\n");
  3346. +          printf("\t---------      ----      -------\n");
  3347.          }
  3348.  
  3349. -      printf("\t%-15.15s%-10.10s%s\n",
  3350. -         sname,
  3351. -         typestr,
  3352. -         comment_offset?rdata+comment_offset-converter:"");
  3353. +      if (sort)
  3354. +        qsort(p,count,20,QSORT_CAST strcasecmp);
  3355. +
  3356. +      for (i=0;i<count;i++)
  3357. +        {
  3358. +          char *sname = p;
  3359. +          int type = SVAL(p,14);
  3360. +          int comment_offset = IVAL(p,16) & 0xFFFF;
  3361. +          fstring typestr="";
  3362. +
  3363. +          switch (type)
  3364. +        {
  3365. +        case STYPE_DISKTREE:
  3366. +          strcpy(typestr,"Disk"); break;
  3367. +        case STYPE_PRINTQ:
  3368. +          strcpy(typestr,"Printer"); break;          
  3369. +        case STYPE_DEVICE:
  3370. +          strcpy(typestr,"Device"); break;
  3371. +        case STYPE_IPC:
  3372. +          strcpy(typestr,"IPC"); break;      
  3373. +        }
  3374. +
  3375. +          printf("\t%-15.15s%-10.10s%s\n",
  3376. +             sname,
  3377. +             typestr,
  3378. +             comment_offset?rdata+comment_offset-converter:"");
  3379.        
  3380. -      if (strlen(sname)>8) long_share_name=True;
  3381. +          if (strlen(sname)>8) long_share_name=True;
  3382.        
  3383. -      p += 20;
  3384. -    }
  3385. -
  3386. -      if (long_share_name) {
  3387. -    printf("\nNOTE: There were share names longer than 8 chars.\nOn older clients these may not be accessible or may give browsing errors\n");
  3388. -      }
  3389. +          p += 20;
  3390. +        }
  3391.  
  3392. -      if (count>0) return(True);
  3393. +      if (long_share_name) {
  3394. +        printf("\nNOTE: There were share names longer than 8 chars.\nOn older clients these may not be accessible or may give browsing errors\n");
  3395. +      }
  3396. +    }
  3397.      }
  3398. -  return(False);
  3399. +  
  3400. +  if (rparam) free(rparam);
  3401. +  if (rdata) free(rdata);
  3402. +
  3403. +  return(count>0);
  3404.  }
  3405.  
  3406.  
  3407. @@ -3422,7 +3503,9 @@
  3408.  ****************************************************************************/
  3409.  static void server_info()
  3410.  {
  3411. -  char *p,*rparam,*rdata;
  3412. +  char *rparam = NULL;
  3413. +  char *rdata = NULL;
  3414. +  char *p;
  3415.    int rdrcnt,rprcnt;
  3416.    pstring param;
  3417.  
  3418. @@ -3448,9 +3531,8 @@
  3419.        int res = SVAL(rparam,0);
  3420.        int converter=SVAL(rparam,2);
  3421.  
  3422. -      if (res != 0)
  3423. -    return;
  3424. -
  3425. +      if (res == 0)
  3426. +    {
  3427.        p = rdata;
  3428.  
  3429.        printf("\nServer=[%s] User=[%s] Workgroup=[%s] Domain=[%s]\n",
  3430. @@ -3459,6 +3541,11 @@
  3431.           rdata+SVAL(p,8)-converter,
  3432.           rdata+SVAL(p,14)-converter);
  3433.      }
  3434. +    }
  3435. +
  3436. +  if (rparam) free(rparam);
  3437. +  if (rdata) free(rdata);
  3438. +
  3439.    return;
  3440.  }
  3441.  
  3442. @@ -3468,9 +3555,13 @@
  3443.  ****************************************************************************/
  3444.  static BOOL list_servers()
  3445.  {
  3446. -  char *p,*rparam,*rdata;
  3447. +  char *rparam = NULL;
  3448. +  char *rdata = NULL;
  3449. +  int rdrcnt,rprcnt;
  3450. +  char *p;
  3451.    pstring param;
  3452.    int uLevel = 1;
  3453. +  int count = -1;
  3454.  
  3455.    int servertype = SV_TYPE_ALL; 
  3456.  
  3457. @@ -3495,21 +3586,17 @@
  3458.  
  3459.    if (call_api(PTR_DIFF(p,param),0,
  3460.             8,10000,
  3461. -           NULL,NULL,
  3462. +           &rprcnt,&rdrcnt,
  3463.             param,NULL,
  3464.             &rparam,&rdata))
  3465.      {
  3466.        int res = SVAL(rparam,0);
  3467.        int converter=SVAL(rparam,2);
  3468. -      int count=SVAL(rparam,4);
  3469.        int i;
  3470.  
  3471. -      if (res != 0)
  3472. +      if (res == 0)
  3473.      {
  3474. -      printf("\nThis machine does not have a browse list\n");
  3475. -      return(False);
  3476. -    }
  3477. -
  3478. +      count=SVAL(rparam,4);
  3479.        p = rdata;
  3480.  
  3481.        if (count > 0)
  3482. @@ -3530,6 +3617,15 @@
  3483.        p += 26;
  3484.      }
  3485.      }
  3486. +      else
  3487. +    {
  3488. +      printf("\nThis machine does not have a browse list\n");
  3489. +    }
  3490. +    }
  3491. +
  3492. +  if (rparam) free(rparam);
  3493. +  if (rdata) free(rdata);
  3494. +
  3495.    return(True);
  3496.  }
  3497.  
  3498. @@ -3574,6 +3670,7 @@
  3499.    {"cancel",cmd_cancel,"<jobid> cancel a print queue entry"},
  3500.    {"stat",cmd_stat,"<file> get info on a file (experimental!)"},
  3501.    {"quit",send_logout,"logoff the server"},
  3502. +  {"q",send_logout,"logoff the server"},
  3503.    {"exit",send_logout,"logoff the server"},
  3504.    {"newer",cmd_newer,"<file> only mget files newer than the specified local file"},
  3505.    {"archive",cmd_archive,"<level>\n0=ignore archive bit\n1=only get archive files\n2=only get archive files and reset archive bit\n3=get all files and reset archive bit"},
  3506. @@ -3588,6 +3685,41 @@
  3507.    {"",NULL,NULL}
  3508.  };
  3509.  
  3510. +
  3511. +/*******************************************************************
  3512. +  lookup a command string in the list of commands, including 
  3513. +  abbreviations
  3514. +  ******************************************************************/
  3515. +static int process_tok(fstring tok)
  3516. +{
  3517. +  int i = 0, matches = 0;
  3518. +  int cmd;
  3519. +  int tok_len = strlen(tok);
  3520. +  
  3521. +  while (commands[i].fn != NULL)
  3522. +    {
  3523. +      if (strequal(commands[i].name,tok))
  3524. +    {
  3525. +      matches = 1;
  3526. +      cmd = i;
  3527. +      break;
  3528. +    }
  3529. +      else if (strnequal(commands[i].name, tok, tok_len+1))
  3530. +    {
  3531. +      matches++;
  3532. +      cmd = i;
  3533. +    }
  3534. +      i++;
  3535. +    }
  3536. +  
  3537. +  if (matches == 0)
  3538. +    return(-1);
  3539. +  else if (matches == 1)
  3540. +    return(cmd);
  3541. +  else
  3542. +    return(-2);
  3543. +}
  3544. +
  3545.  /****************************************************************************
  3546.  help
  3547.  ****************************************************************************/
  3548. @@ -3598,12 +3730,8 @@
  3549.  
  3550.    if (next_token(NULL,buf,NULL))
  3551.      {
  3552. -      while (commands[i].description)
  3553. -    {
  3554. -      if (strequal(commands[i].name,buf))      
  3555. -        DEBUG(0,("HELP %s:\n\t%s\n\n",commands[i].name,commands[i].description));
  3556. -      i++;
  3557. -    }
  3558. +      if ((i = process_tok(buf)) >= 0)
  3559. +    DEBUG(0,("HELP %s:\n\t%s\n\n",commands[i].name,commands[i].description));            
  3560.      }
  3561.    else
  3562.      while (commands[i].description)
  3563. @@ -3765,7 +3893,7 @@
  3564.    DEBUG(1,("Trying to re-open connection\n"));
  3565.  
  3566.    set_message(outbuf,0,0,True);
  3567. -  CVAL(outbuf,smb_com) = SMBtdis;
  3568. +  SCVAL(outbuf,smb_com,SMBtdis);
  3569.    SSVAL(outbuf,smb_tid,cnum);
  3570.    setup_pkt(outbuf);
  3571.  
  3572. @@ -3783,6 +3911,7 @@
  3573.  ****************************************************************************/
  3574.  BOOL process(void )
  3575.  {
  3576. +  extern FILE *dbf;
  3577.    pstring line;
  3578.  
  3579.    char *InBuffer = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN);
  3580. @@ -3800,12 +3929,12 @@
  3581.      {
  3582.        fstring tok;
  3583.        int i;
  3584. -      BOOL found = False;
  3585.  
  3586.        bzero(OutBuffer,smb_size);
  3587.  
  3588.        /* display a prompt */
  3589.        DEBUG(1,("smb: %s> ", CNV_LANG(cur_dir)));
  3590. +      fflush(dbf);
  3591.  
  3592.  #ifdef CLIX
  3593.        line[0] = wait_keyboard(InBuffer);
  3594. @@ -3839,18 +3968,12 @@
  3595.      char *ptr = line;
  3596.      if (!next_token(&ptr,tok,NULL)) continue;
  3597.        }
  3598. -      
  3599. -      i = 0;
  3600. -      while (commands[i].fn != NULL)
  3601. -    {
  3602. -      if (strequal(commands[i].name,tok))
  3603. -        {
  3604. -          found = True;
  3605. -          commands[i].fn(InBuffer,OutBuffer);
  3606. -        }
  3607. -      i++;
  3608. -    }
  3609. -      if (!found)
  3610. +
  3611. +      if ((i = process_tok(tok)) >= 0)
  3612. +    commands[i].fn(InBuffer,OutBuffer);
  3613. +      else if (i == -2)
  3614. +    DEBUG(0,("%s: command abbreviation ambiguous\n",CNV_LANG(tok)));
  3615. +      else
  3616.      DEBUG(0,("%s: command not found\n",CNV_LANG(tok)));
  3617.      }
  3618.    
  3619. @@ -3884,6 +4007,7 @@
  3620.    DEBUG(0,("\t-I dest IP            use this IP to connect to\n"));
  3621.    DEBUG(0,("\t-E                    write messages to stderr instead of stdout\n"));
  3622.    DEBUG(0,("\t-U username           set the network username\n"));
  3623. +  DEBUG(0,("\t-W workgroup          set the workgroup name\n"));
  3624.  #ifdef KANJI
  3625.    DEBUG(0,("\t-t terminal code      terminal i/o code {sjis|euc|jis7|jis8|junet|hex}\n"));
  3626.  #endif /* KANJI */
  3627. @@ -3908,8 +4032,9 @@
  3628.    *query_host = 0;
  3629.  
  3630.    DEBUGLEVEL = 2;
  3631. -  dbf = stdout;
  3632.  
  3633. +  setup_logging(pname,True);
  3634. +
  3635.    TimeInit();
  3636.    charset_initialise();
  3637.  
  3638. @@ -3973,9 +4098,9 @@
  3639.  
  3640.  #ifdef KANJI
  3641.    setup_term_code (KANJI);
  3642. -  while ((opt = getopt (argc, argv, "O:M:i:Nn:d:Pp:l:hI:EB:U:L:t:m:")) != EOF)
  3643. +  while ((opt = getopt (argc, argv, "O:M:i:Nn:d:Pp:l:hI:EB:U:L:t:m:W:")) != EOF)
  3644.  #else
  3645. -  while ((opt = getopt (argc, argv, "O:M:i:Nn:d:Pp:l:hI:EB:U:L:m:")) != EOF)
  3646. +  while ((opt = getopt (argc, argv, "O:M:i:Nn:d:Pp:l:hI:EB:U:L:m:W:")) != EOF)
  3647.  #endif /* KANJI */
  3648.      switch (opt)
  3649.        {
  3650. @@ -4012,6 +4137,9 @@
  3651.      }
  3652.          
  3653.      break;
  3654. +      case 'W':
  3655. +    strcpy(workgroup,optarg);
  3656. +    break;
  3657.        case 'E':
  3658.      dbf = stderr;
  3659.      break;
  3660. @@ -4100,9 +4228,9 @@
  3661.          return(1);
  3662.  
  3663.        server_info();
  3664. -      if (!browse_host()) {
  3665. +      if (!browse_host(True)) {
  3666.          sleep(1);
  3667. -        browse_host();
  3668. +        browse_host(True);
  3669.        }
  3670.        list_servers();
  3671.  
  3672. diff -u -r --new-file last-version/source/clitar.c samba-1.9.15p5/source/clitar.c
  3673. --- last-version/source/clitar.c    Thu Nov 23 10:07:28 1995
  3674. +++ samba-1.9.15p5/source/clitar.c    Thu Nov 30 09:35:34 1995
  3675. @@ -27,8 +27,8 @@
  3676.  extern BOOL reopen_connection(char *inbuf,char *outbuf);
  3677.  extern void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir);
  3678.  
  3679. +extern BOOL recurse;
  3680.  
  3681. -
  3682.  #define SEPARATORS " \t\n\r"
  3683.  extern int DEBUGLEVEL;
  3684.  extern int Client;
  3685. @@ -772,7 +772,7 @@
  3686.        strcat(mtar_mask,"*.*");
  3687.        
  3688.        do_dir((char *)inbuf,(char *)outbuf,
  3689. -         mtar_mask,aSYSTEM | aHIDDEN | aDIR,do_tar,False);
  3690. +         mtar_mask,aSYSTEM | aHIDDEN | aDIR,do_tar,recurse);
  3691.        strcpy(cur_dir,saved_curdir);
  3692.        free(inbuf);free(outbuf);
  3693.      }
  3694. @@ -1402,7 +1402,7 @@
  3695.      else
  3696.        strcat(tarmac,"*.*");
  3697.      
  3698. -    do_dir((char *)inbuf,(char *)outbuf,tarmac,attribute,do_tar,False);
  3699. +    do_dir((char *)inbuf,(char *)outbuf,tarmac,attribute,do_tar,recurse);
  3700.      
  3701.      if (ntarf) dotareof(tarhandle);
  3702.      close(tarhandle);
  3703. diff -u -r --new-file last-version/source/dir.c samba-1.9.15p5/source/dir.c
  3704. --- last-version/source/dir.c    Fri Nov 10 11:18:03 1995
  3705. +++ samba-1.9.15p5/source/dir.c    Sun Dec  3 19:26:50 1995
  3706. @@ -94,7 +94,7 @@
  3707.  {
  3708.    int i;
  3709.    uint32 old=dircounter+1;
  3710. -  int oldi=-1;
  3711. +  int oldi= -1;
  3712.    for (i=0;i<NUMDIRPTRS;i++)
  3713.      if (dirptrs[i].valid && dirptrs[i].ptr && dirptrs[i].lastused < old) {
  3714.        old = dirptrs[i].lastused;
  3715. @@ -282,7 +282,7 @@
  3716.    /* as a 2nd option, grab the oldest not marked for expect_close */
  3717.    if (i == -1) {
  3718.      old=dircounter+1;
  3719. -    oldi=-1;
  3720. +    oldi= -1;
  3721.      for (i=0;i<NUMDIRPTRS;i++)
  3722.        if (!dirptrs[i].expect_close && dirptrs[i].lastused < old) {
  3723.      old = dirptrs[i].lastused;
  3724. @@ -294,7 +294,7 @@
  3725.    /* a 3rd option - grab the oldest one */
  3726.    if (i == -1) {
  3727.      old=dircounter+1;
  3728. -    oldi=-1;
  3729. +    oldi= -1;
  3730.      for (i=0;i<NUMDIRPTRS;i++)
  3731.        if (dirptrs[i].lastused < old) {
  3732.      old = dirptrs[i].lastused;
  3733. diff -u -r --new-file last-version/source/ipc.c samba-1.9.15p5/source/ipc.c
  3734. --- last-version/source/ipc.c    Thu Nov 23 14:28:05 1995
  3735. +++ samba-1.9.15p5/source/ipc.c    Sun Dec  3 00:17:42 1995
  3736. @@ -55,11 +55,6 @@
  3737.  #define ACCESS_WRITE 0x02
  3738.  #define ACCESS_CREATE 0x04
  3739.  
  3740. -#define STYPE_DISKTREE    0    /* Disk drive */
  3741. -#define STYPE_PRINTQ    1    /* Spooler queue */
  3742. -#define STYPE_DEVICE    2    /* Serial device */
  3743. -#define STYPE_IPC    3    /* Interprocess communication (IPC) */
  3744. -
  3745.  #define SHPWLEN 8        /* share password length */
  3746.  #define NNLEN 12        /* 8.3 net name length */
  3747.  #define SNLEN 15        /* service name length */
  3748. @@ -916,7 +911,8 @@
  3749.    if (!prefix_ok(str1,"WrLehD")) return False;
  3750.    if (!check_server_info(uLevel,str2)) return False;
  3751.    
  3752. -  total = get_server_info(servertype,&servers);
  3753. +  if (lp_browse_list())
  3754. +    total = get_server_info(servertype,&servers);
  3755.  
  3756.    data_len = fixed_len = string_len = 0;
  3757.  
  3758. diff -u -r --new-file last-version/source/loadparm.c samba-1.9.15p5/source/loadparm.c
  3759. --- last-version/source/loadparm.c    Thu Nov 23 13:35:22 1995
  3760. +++ samba-1.9.15p5/source/loadparm.c    Sun Dec  3 00:17:01 1995
  3761. @@ -158,6 +158,7 @@
  3762.     BOOL bReadPrediction;
  3763.     BOOL bReadbmpx;
  3764.     BOOL bSyslogOnly;
  3765. +   BOOL bBrowseList;
  3766.  } global;
  3767.  
  3768.  static global Globals;
  3769. @@ -407,6 +408,7 @@
  3770.    {"preferred master", P_BOOL,    P_GLOBAL, &Globals.bPreferredMaster,  NULL},
  3771.    {"prefered master",  P_BOOL,    P_GLOBAL, &Globals.bPreferredMaster,  NULL},
  3772.    {"domain master",    P_BOOL,    P_GLOBAL, &Globals.bDomainMaster,     NULL},
  3773. +  {"browse list",      P_BOOL,    P_GLOBAL, &Globals.bBrowseList,       NULL},
  3774.  
  3775.    {"-valid",           P_BOOL,    P_LOCAL,  &sDefault.valid,            NULL},
  3776.    {"comment",          P_STRING,  P_LOCAL,  &sDefault.comment,          NULL},
  3777. @@ -556,6 +558,7 @@
  3778.    Globals.max_ttl = 60*60*4; /* 2 hours default */
  3779.    Globals.bPreferredMaster = True;
  3780.    Globals.bDomainMaster = False;
  3781. +  Globals.bBrowseList = True;
  3782.  
  3783.  #ifdef KANJI
  3784.    coding_system = interpret_coding_system (KANJI, SJIS_CODE);
  3785. @@ -678,6 +681,7 @@
  3786.  FN_GLOBAL_BOOL(lp_strip_dot,&Globals.bStripDot)
  3787.  FN_GLOBAL_BOOL(lp_encrypted_passwords,&Globals.bEncryptPasswords)
  3788.  FN_GLOBAL_BOOL(lp_syslog_only,&Globals.bSyslogOnly)
  3789. +FN_GLOBAL_BOOL(lp_browse_list,&Globals.bBrowseList)
  3790.  
  3791.  FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level)
  3792.  FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl)
  3793. @@ -1199,8 +1203,8 @@
  3794.  
  3795.  #ifdef KANJI
  3796.  /***************************************************************************
  3797. -handle the interpretation of the conding system parameter
  3798. -***************************************************************************/
  3799. +  handle the interpretation of the coding system parameter
  3800. +  *************************************************************************/
  3801.  static BOOL handle_coding_system(char *pszParmValue,int *val)
  3802.  {
  3803.    *val = interpret_coding_system(pszParmValue,*val);
  3804. diff -u -r --new-file last-version/source/loadparm.h samba-1.9.15p5/source/loadparm.h
  3805. --- last-version/source/loadparm.h    Thu Nov 23 11:18:52 1995
  3806. +++ samba-1.9.15p5/source/loadparm.h    Sun Dec  3 00:17:16 1995
  3807. @@ -76,6 +76,7 @@
  3808.  extern BOOL lp_strip_dot(void);
  3809.  extern BOOL lp_encrypted_passwords(void);
  3810.  extern BOOL lp_syslog_only(void);
  3811. +extern BOOL lp_browse_list(void);
  3812.  extern int  lp_numservices(void);
  3813.  extern int  lp_keepalive(void);
  3814.  extern int  lp_passwordlevel(void);
  3815. diff -u -r --new-file last-version/source/local.h samba-1.9.15p5/source/local.h
  3816. --- last-version/source/local.h    Sat Nov 11 16:59:22 1995
  3817. +++ samba-1.9.15p5/source/local.h    Sun Dec  3 21:42:38 1995
  3818. @@ -38,7 +38,7 @@
  3819.  /* max number of directories open at once */
  3820.  /* note that with the new directory code this no longer requires a
  3821.     file handle per directory, but large numbers do use more memory */
  3822. -#define MAXDIR 120
  3823. +#define MAXDIR 64
  3824.  
  3825.  #define WORDMAX 0xFFFF
  3826.  
  3827. @@ -118,7 +118,7 @@
  3828.  #define SHARE_MODES_CHECK (10)
  3829.  #define SHARE_MODES_CLEAN (300)
  3830.  #define IDLE_CLOSED_TIMEOUT (30)
  3831. -#define DPTR_IDLE_TIMEOUT (300)
  3832. +#define DPTR_IDLE_TIMEOUT (120)
  3833.  #define SMBD_SELECT_LOOP (10)
  3834.  #define NMBD_SELECT_LOOP (10)
  3835.  #define BROWSE_INTERVAL (60)
  3836. diff -u -r --new-file last-version/source/locking.c samba-1.9.15p5/source/locking.c
  3837. --- last-version/source/locking.c    Sat Nov  4 22:03:18 1995
  3838. +++ samba-1.9.15p5/source/locking.c    Sat Dec  2 18:36:23 1995
  3839. @@ -97,80 +97,58 @@
  3840.  }
  3841.  
  3842.  /*******************************************************************
  3843. -name a share file
  3844. -********************************************************************/
  3845. -static BOOL share_name(int fnum,char *name)
  3846. +  name a share file
  3847. +  ******************************************************************/
  3848. +static BOOL share_name(int cnum,struct stat *st,char *name)
  3849.  {
  3850. -  struct stat st;
  3851.    strcpy(name,lp_lockdir());
  3852. -  standard_sub(Files[fnum].cnum,name);
  3853. +  standard_sub(cnum,name);
  3854.    trim_string(name,"","/");
  3855.    if (!*name) return(False);
  3856.    name += strlen(name);
  3857.    
  3858. -  if (fstat(Files[fnum].fd,&st) == -1)
  3859. -    return(False);
  3860. -
  3861. -  sprintf(name,"/share.%d.%d",(int)st.st_dev,(int)st.st_ino);
  3862. +  sprintf(name,"/share.%d.%d",(int)st->st_dev,(int)st->st_ino);
  3863.    return(True);
  3864.  }
  3865.  
  3866.  /*******************************************************************
  3867. -get the share mode of a file
  3868. -********************************************************************/
  3869. -int get_share_mode(int fnum,int *pid)
  3870. +  use the fnum to get the share file name
  3871. +  ******************************************************************/
  3872. +static BOOL share_name_fnum(int fnum,char *name)
  3873.  {
  3874. -  pstring fname;
  3875. -  int fd2;
  3876. -  char buf[16];
  3877. -  int ret;
  3878. -  time_t t;
  3879. -
  3880. -  *pid = 0;
  3881. -
  3882. -  if (!share_name(fnum,fname)) return(0);
  3883. -
  3884. -  fd2 = open(fname,O_RDONLY,0);
  3885. -  if (fd2 < 0) return(0);
  3886. -
  3887. -  if (read(fd2,buf,16) != 16) {
  3888. -    close(fd2);
  3889. -    unlink(fname);
  3890. -    return(0);
  3891. -  }
  3892. -  close(fd2);
  3893. -
  3894. -  t = IVAL(buf,0);
  3895. -  ret = IVAL(buf,4);
  3896. -  *pid = IVAL(buf,8);
  3897. -  
  3898. -  if (IVAL(buf,12) != LOCKING_VERSION) {    
  3899. -    if (!unlink(fname)) DEBUG(2,("Deleted old locking file %s",fname));
  3900. -    *pid = 0;
  3901. -    return(0);
  3902. -  }
  3903. +  struct stat st;
  3904. +  if (fstat(Files[fnum].fd,&st) != 0) return(False);
  3905. +  return(share_name(Files[fnum].cnum,&st,name));
  3906. +}
  3907.  
  3908. -  if (*pid && !process_exists(*pid)) {
  3909. -    ret=0;
  3910. -    *pid = 0;
  3911. -  }
  3912.  
  3913. -  if (! *pid) unlink(fname); /* XXXXX race, race */
  3914. +/*******************************************************************
  3915. +  get the share mode of a file using the fnum
  3916. +  ******************************************************************/
  3917. +int get_share_mode_by_fnum(int cnum,int fnum,int *pid)
  3918. +{
  3919. +  struct stat sbuf;
  3920. +  if (fstat(Files[fnum].fd,&sbuf) == -1) return(0);
  3921. +  return(get_share_mode(cnum,&sbuf,pid));
  3922. +}
  3923.  
  3924. -  if (*pid)
  3925. -    DEBUG(5,("Read share file %s mode 0x%X pid=%d\n",fname,ret,*pid));
  3926. +/*******************************************************************
  3927. +  get the share mode of a file using the files name
  3928. +  ******************************************************************/
  3929. +int get_share_mode_byname(int cnum,char *fname,int *pid)
  3930. +{
  3931. +  struct stat sbuf;
  3932. +  if (stat(fname,&sbuf) == -1) return(0);
  3933. +  return(get_share_mode(cnum,&sbuf,pid));
  3934. +}  
  3935.  
  3936. -  return(ret);
  3937. -}
  3938.  
  3939.  /*******************************************************************
  3940. -get the share mode of a file using the files name
  3941. +get the share mode of a file
  3942.  ********************************************************************/
  3943. -int get_share_mode_byname(int cnum,char *fname,int *pid)
  3944. +int get_share_mode(int cnum,struct stat *sbuf,int *pid)
  3945.  {
  3946. -  struct stat st;
  3947. -  pstring lname;
  3948. -  char *name;
  3949. +  pstring fname;
  3950.    int fd2;
  3951.    char buf[16];
  3952.    int ret;
  3953. @@ -178,25 +156,14 @@
  3954.  
  3955.    *pid = 0;
  3956.  
  3957. -  name = lname;
  3958. -
  3959. -  strcpy(name,lp_lockdir());
  3960. -  standard_sub(cnum,name);
  3961. -  trim_string(name,"","/");
  3962. -  if (!*name) return(0);
  3963. -  name += strlen(name);
  3964. -  
  3965. -  if (stat(fname,&st) == -1)
  3966. -    return(0);
  3967. -
  3968. -  sprintf(name,"/share.%d.%d",(int)st.st_dev,(int)st.st_ino);
  3969. +  if (!share_name(cnum,sbuf,fname)) return(0);
  3970.  
  3971. -  fd2 = open(lname,O_RDONLY,0);
  3972. +  fd2 = open(fname,O_RDONLY,0);
  3973.    if (fd2 < 0) return(0);
  3974.  
  3975.    if (read(fd2,buf,16) != 16) {
  3976.      close(fd2);
  3977. -    unlink(lname);
  3978. +    unlink(fname);
  3979.      return(0);
  3980.    }
  3981.    close(fd2);
  3982. @@ -206,7 +173,7 @@
  3983.    *pid = IVAL(buf,8);
  3984.    
  3985.    if (IVAL(buf,12) != LOCKING_VERSION) {    
  3986. -    if (!unlink(lname)) DEBUG(2,("Deleted old locking file %s",lname));
  3987. +    if (!unlink(fname)) DEBUG(2,("Deleted old locking file %s",fname));
  3988.      *pid = 0;
  3989.      return(0);
  3990.    }
  3991. @@ -216,10 +183,10 @@
  3992.      *pid = 0;
  3993.    }
  3994.  
  3995. -  if (! *pid) unlink(lname); /* XXXXX race, race */
  3996. +  if (! *pid) unlink(fname); /* XXXXX race, race */
  3997.  
  3998.    if (*pid)
  3999. -    DEBUG(5,("Read share file %s mode 0x%X pid=%d\n",lname,ret,*pid));
  4000. +    DEBUG(5,("Read share file %s mode 0x%X pid=%d\n",fname,ret,*pid));
  4001.  
  4002.    return(ret);
  4003.  }
  4004. @@ -237,7 +204,7 @@
  4005.    int pid=0;
  4006.    BOOL del = False;
  4007.  
  4008. -  if (!share_name(fnum,fname)) return;
  4009. +  if (!share_name_fnum(fnum,fname)) return;
  4010.  
  4011.    fd2 = open(fname,O_RDONLY,0);
  4012.    if (fd2 < 0) return;
  4013. @@ -279,7 +246,7 @@
  4014.    char buf[16];
  4015.    int pid = (int)getpid();
  4016.  
  4017. -  if (!share_name(fnum,fname)) return(False);
  4018. +  if (!share_name_fnum(fnum,fname)) return(False);
  4019.  
  4020.    {
  4021.      int old_umask = umask(0);
  4022. diff -u -r --new-file last-version/source/mangle.c samba-1.9.15p5/source/mangle.c
  4023. --- last-version/source/mangle.c    Fri Nov 24 14:55:22 1995
  4024. +++ samba-1.9.15p5/source/mangle.c    Sun Dec  3 19:29:18 1995
  4025. @@ -83,9 +83,14 @@
  4026.  BOOL is_8_3(char *fname)
  4027.  {
  4028.    int len = strlen(fname);
  4029. -  char *dot_pos = strchr(fname,'.');
  4030. +  char *dot_pos;
  4031. +  char *slash_pos = strrchr(fname,'/');
  4032.    int l;
  4033.  
  4034. +  if (slash_pos) fname = slash_pos+1;
  4035. +
  4036. +  dot_pos = strchr(fname,'.');
  4037. +
  4038.    DEBUG(5,("checking %s for 8.3\n",fname));
  4039.  
  4040.    if (case_mangle)
  4041. @@ -238,10 +243,12 @@
  4042.  {
  4043.    int i;
  4044.    pstring tmpname;
  4045. -  char extension[5]="";
  4046. +  char extension[5];
  4047.    char *p = strrchr(s,'.');
  4048.    BOOL check_extension = False;
  4049.  
  4050. +  extension[0] = 0;
  4051. +
  4052.    if (!mangled_stack) return(False);
  4053.  
  4054.    if (p)
  4055. @@ -468,11 +475,14 @@
  4056.  {
  4057.    int csum = str_checksum(s);
  4058.    char *p;
  4059. -  char extension[4] = "";
  4060. -  char base[9]="";
  4061. +  char extension[4];
  4062. +  char base[9];
  4063.    int baselen = 0;
  4064.    int extlen = 0;
  4065.  
  4066. +  extension[0]=0;
  4067. +  base[0]=0;
  4068. +
  4069.    p = strrchr(s,'.');  
  4070.    if (p && (strlen(p+1)<4) )
  4071.      {
  4072. @@ -549,8 +559,21 @@
  4073.        illegal[*s] = True;
  4074.    }
  4075.  
  4076. +#ifdef KANJI
  4077. +  for (s = (unsigned char *)name; *s;) {
  4078. +    if (is_shift_jis (*s)) {
  4079. +      s += 2;
  4080. +    } else if (illegal[*s]) {
  4081. +      return(True);
  4082. +    } else {
  4083. +      s++;
  4084. +    }
  4085. +  }
  4086. +#else
  4087.    for (s = (unsigned char *)name;*s;s++)
  4088.      if (illegal[*s]) return(True);
  4089. +#endif
  4090. +
  4091.  
  4092.    return(False);
  4093.  }
  4094. diff -u -r --new-file last-version/source/nameserv.c samba-1.9.15p5/source/nameserv.c
  4095. --- last-version/source/nameserv.c    Fri Nov 24 14:28:09 1995
  4096. +++ samba-1.9.15p5/source/nameserv.c    Sat Dec  2 19:28:23 1995
  4097. @@ -2080,9 +2080,7 @@
  4098.  
  4099.    TimeInit();
  4100.  
  4101. -#ifdef SYSLOG
  4102. -  openlog(argv[0], LOG_PID, LOG_DAEMON);
  4103. -#endif
  4104. +  setup_logging(argv[0],False);
  4105.  
  4106.    charset_initialise();
  4107.  
  4108. diff -u -r --new-file last-version/source/nmblookup.c samba-1.9.15p5/source/nmblookup.c
  4109. --- last-version/source/nmblookup.c    Thu Nov 23 11:14:01 1995
  4110. +++ samba-1.9.15p5/source/nmblookup.c    Sun Dec  3 19:27:46 1995
  4111. @@ -36,7 +36,7 @@
  4112.  
  4113.  static BOOL got_bcast = False;
  4114.  
  4115. -int ServerFD=-1;
  4116. +int ServerFD= -1;
  4117.  
  4118.  /****************************************************************************
  4119.    open the socket communication
  4120. @@ -113,7 +113,6 @@
  4121.    int opt;
  4122.    unsigned int lookup_type = 0x20;
  4123.    pstring lookup;
  4124. -  extern FILE *dbf;
  4125.    extern int optind;
  4126.    extern char *optarg;
  4127.    BOOL find_master=False;
  4128. @@ -124,13 +123,10 @@
  4129.    *lookup = 0;
  4130.  
  4131.    TimeInit();
  4132. -  charset_initialise();
  4133.  
  4134. -#ifdef SYSLOG
  4135. -  openlog(argv[0], LOG_PID, LOG_DAEMON);
  4136. -#endif
  4137. +  setup_logging(argv[0],True);
  4138.  
  4139. -  dbf = stdout;
  4140. +  charset_initialise();
  4141.  
  4142.    while ((opt = getopt(argc, argv, "p:d:B:i:SMh")) != EOF)
  4143.      switch (opt)
  4144. diff -u -r --new-file last-version/source/password.c samba-1.9.15p5/source/password.c
  4145. --- last-version/source/password.c    Fri Nov 24 23:19:53 1995
  4146. +++ samba-1.9.15p5/source/password.c    Sun Dec  3 19:27:35 1995
  4147. @@ -26,8 +26,13 @@
  4148.  extern int Protocol;
  4149.  
  4150.  /* users from session setup */
  4151. -pstring session_users="";
  4152. +static pstring session_users="";
  4153.  
  4154. +/* these are kept here to keep the string_combinations function simple */
  4155. +static char this_user[100]="";
  4156. +static char this_salt[100]="";
  4157. +static char this_crypted[100]="";
  4158. +
  4159.  #ifdef SMB_PASSWD
  4160.  /* Data to do lanman1/2 password challenge. */
  4161.  static unsigned char saved_challenge[8];
  4162. @@ -53,6 +58,16 @@
  4163.  }
  4164.  
  4165.  /*******************************************************************
  4166. +set the last challenge sent, usually from a password server
  4167. +********************************************************************/
  4168. +BOOL set_challenge(char *challenge)
  4169. +{
  4170. +  memcpy(saved_challenge,challenge,8);
  4171. +  challenge_sent = True;
  4172. +  return(True);
  4173. +}
  4174. +
  4175. +/*******************************************************************
  4176.  get the last challenge sent
  4177.  ********************************************************************/
  4178.  BOOL last_challenge(char *challenge)
  4179. @@ -333,13 +348,15 @@
  4180.  
  4181.  
  4182.  #ifdef DFS_AUTH
  4183. +
  4184. +sec_login_handle_t my_dce_sec_context;
  4185. +int dcelogin_atmost_once = 0;
  4186. +
  4187.  /*******************************************************************
  4188.  check on a DCE/DFS authentication
  4189.  ********************************************************************/
  4190.  static BOOL dfs_auth(char *this_user,char *password)
  4191.  {
  4192. -  static sec_login_handle_t my_dce_sec_context;
  4193. -  static int dcelogin_atmost_once = 0;
  4194.    error_status_t err;
  4195.    int err2;
  4196.    int prterr;
  4197. @@ -394,7 +411,7 @@
  4198.        dce_error_inq_text(err, dce_errstr, &err2);
  4199.        DEBUG(0,("DCE login failed for principal %s, cant set context: %s\n",
  4200.             this_user,dce_errstr));
  4201. -      sec_login_purge_context(my_dce_sec_context, &err2);
  4202. +      sec_login_purge_context(my_dce_sec_context, &err);
  4203.        return(False);
  4204.      }
  4205.    else
  4206. @@ -406,6 +423,22 @@
  4207.    dcelogin_atmost_once = 1;
  4208.    return (True);
  4209.  }
  4210. +
  4211. +void dfs_unlogin(void)
  4212. +{
  4213. +  error_status_t err;
  4214. +  int err2;
  4215. +  unsigned char dce_errstr[dce_c_error_string_len];
  4216. +
  4217. +  sec_login_purge_context(my_dce_sec_context, &err);
  4218. +  if (err != error_status_ok )
  4219. +    {  
  4220. +      dce_error_inq_text(err, dce_errstr, &err2);
  4221. +      DEBUG(0,("DCE purge login context failed for server instance %d: %s\n",
  4222. +           getpid(), dce_errstr));
  4223. +    }
  4224. +}
  4225. +
  4226.  #endif
  4227.  
  4228.  
  4229. @@ -482,11 +515,6 @@
  4230.  }
  4231.  
  4232.  
  4233. -/* these are kept here to keep the string_combinations function simple */
  4234. -char this_user[100]="";
  4235. -char this_salt[100]="";
  4236. -char this_crypted[100]="";
  4237. -
  4238.  
  4239.  /****************************************************************************
  4240.  core of password checking routine
  4241. @@ -1215,7 +1243,7 @@
  4242.  
  4243.    if (password_client >= 0) {
  4244.      close(password_client);
  4245. -    password_client=-1;
  4246. +    password_client= -1;
  4247.    }
  4248.  
  4249.    if (Protocol < PROTOCOL_NT1) {
  4250. @@ -1294,13 +1322,13 @@
  4251.  
  4252.    if (!ret || CVAL(inbuf,smb_rcls) || SVAL(inbuf,smb_vwv0)) {
  4253.      DEBUG(1,("%s rejected the protocol\n",pserver));
  4254. -    close(password_client); password_client=-1;
  4255. +    close(password_client); password_client= -1;
  4256.      return(False);
  4257.    }
  4258.  
  4259.    if (!(CVAL(inbuf,smb_vwv1) & 1)) {
  4260.      DEBUG(1,("%s isn't in user level security mode\n",pserver));
  4261. -    close(password_client); password_client=-1;
  4262. +    close(password_client); password_client= -1;
  4263.      return(False);
  4264.    }
  4265.  
  4266. @@ -1354,7 +1382,7 @@
  4267.    DEBUG(3,("password server %s accepted the password\n",pserver));
  4268.  
  4269.  #ifndef KEEP_PASSWORD_SERVER_OPEN
  4270. -  close(password_client); password_client=-1;
  4271. +  close(password_client); password_client= -1;
  4272.  #endif
  4273.  
  4274.    return(True);
  4275. diff -u -r --new-file last-version/source/printing.c samba-1.9.15p5/source/printing.c
  4276. --- last-version/source/printing.c    Sun Nov 12 12:06:48 1995
  4277. +++ samba-1.9.15p5/source/printing.c    Sun Dec  3 19:28:08 1995
  4278. @@ -70,8 +70,7 @@
  4279.    
  4280.    /* look for "%s" in the string. If there is no %s, we cannot print. */   
  4281.    if (!strstr(syscmd, "%s") && !strstr(syscmd, "%f")) {
  4282. -    DEBUG(2,("WARNING! No placeholder for the filename in the print command "
  4283. -         "for service %s!\n", SERVICE(snum)));
  4284. +    DEBUG(2,("WARNING! No placeholder for the filename in the print command for service %s!\n", SERVICE(snum)));
  4285.    }
  4286.    
  4287.    if (strstr(syscmd,"%s")) {
  4288. diff -u -r --new-file last-version/source/reply.c samba-1.9.15p5/source/reply.c
  4289. --- last-version/source/reply.c    Wed Nov 22 21:35:16 1995
  4290. +++ samba-1.9.15p5/source/reply.c    Sun Dec  3 19:27:15 1995
  4291. @@ -43,7 +43,7 @@
  4292.  
  4293.  /* this macro should always be used to extract an fnum (smb_fid) from
  4294.  a packet to ensure chaining works correctly */
  4295. -#define GETFNUM(buf,where) (chain_fnum!=-1?chain_fnum:SVAL(buf,where))
  4296. +#define GETFNUM(buf,where) (chain_fnum!= -1?chain_fnum:SVAL(buf,where))
  4297.  
  4298.  
  4299.  /****************************************************************************
  4300. @@ -637,7 +637,7 @@
  4301.    int status_len;
  4302.    char *path;
  4303.    char status[21];
  4304. -  int dptr_num=-1;
  4305. +  int dptr_num= -1;
  4306.    BOOL check_descend = False;
  4307.    BOOL expect_close = False;
  4308.    BOOL can_open = True;
  4309. @@ -853,7 +853,7 @@
  4310.    int status_len;
  4311.    char *path;
  4312.    char status[21];
  4313. -  int dptr_num=-1;
  4314. +  int dptr_num= -1;
  4315.  
  4316.    cnum = SVAL(inbuf,smb_tid);
  4317.  
  4318. @@ -1365,7 +1365,7 @@
  4319.  /****************************************************************************
  4320.    reply to a lockread (core+ protocol)
  4321.  ****************************************************************************/
  4322. -int reply_lockread(char *inbuf,char *outbuf,int length,int bufsize)
  4323. +int reply_lockread(char *inbuf,char *outbuf)
  4324.  {
  4325.    int cnum,fnum;
  4326.    int nread = -1;
  4327. @@ -1386,7 +1386,7 @@
  4328.    startpos = IVAL(inbuf,smb_vwv2);
  4329.    
  4330.    outsize = set_message(outbuf,5,3,True);
  4331. -  numtoread = MIN(bufsize-outsize,numtoread);
  4332. +  numtoread = MIN(BUFFER_SIZE-outsize,numtoread);
  4333.    data = smb_buf(outbuf) + 3;
  4334.    
  4335.    if(!do_lock( fnum, cnum, numtoread, startpos, &eclass, &ecode))
  4336. @@ -1411,7 +1411,7 @@
  4337.  /****************************************************************************
  4338.    reply to a read
  4339.  ****************************************************************************/
  4340. -int reply_read(char *inbuf,char *outbuf,int length,int bufsize)
  4341. +int reply_read(char *inbuf,char *outbuf)
  4342.  {
  4343.    int cnum,numtoread,fnum;
  4344.    int nread = 0;
  4345. @@ -1430,7 +1430,7 @@
  4346.    startpos = IVAL(inbuf,smb_vwv2);
  4347.    
  4348.    outsize = set_message(outbuf,5,3,True);
  4349. -  numtoread = MIN(bufsize-outsize,numtoread);
  4350. +  numtoread = MIN(BUFFER_SIZE-outsize,numtoread);
  4351.    data = smb_buf(outbuf) + 3;
  4352.    
  4353.    if (is_locked(fnum,cnum,numtoread,startpos))
  4354. @@ -1515,7 +1515,7 @@
  4355.  /****************************************************************************
  4356.    reply to a writebraw (core+ or LANMAN1.0 protocol)
  4357.  ****************************************************************************/
  4358. -int reply_writebraw(char *inbuf,char *outbuf,int length,int bufsize)
  4359. +int reply_writebraw(char *inbuf,char *outbuf)
  4360.  {
  4361.    int nwritten=0;
  4362.    int total_written=0;
  4363. @@ -1527,9 +1527,6 @@
  4364.    BOOL write_through;
  4365.    int tcount;
  4366.  
  4367. -  /* this is just to stop silly warnings */
  4368. -  length = bufsize = 0;
  4369. -  
  4370.    cnum = SVAL(inbuf,smb_tid);
  4371.    fnum = GETFNUM(inbuf,smb_vwv0);
  4372.  
  4373. @@ -1825,7 +1822,7 @@
  4374.  {
  4375.    int cnum,fnum;
  4376.    uint32 startpos;
  4377. -  int32 res=-1;
  4378. +  int32 res= -1;
  4379.    int mode,umode;
  4380.    int outsize = 0;
  4381.    
  4382. @@ -2335,7 +2332,7 @@
  4383.  {
  4384.    pstring directory;
  4385.    int cnum;
  4386. -  int outsize,ret=-1;
  4387. +  int outsize,ret= -1;
  4388.    
  4389.    strcpy(directory,smb_buf(inbuf) + 1);
  4390.    cnum = SVAL(inbuf,smb_tid);
  4391. diff -u -r --new-file last-version/source/reply.h samba-1.9.15p5/source/reply.h
  4392. --- last-version/source/reply.h    Wed Nov 22 21:52:38 1995
  4393. +++ samba-1.9.15p5/source/reply.h    Sun Dec  3 11:57:49 1995
  4394. @@ -22,10 +22,10 @@
  4395.  int reply_ctemp(char *inbuf,char *outbuf);
  4396.  int reply_unlink(char *inbuf,char *outbuf);
  4397.  int reply_readbraw(char *inbuf, char *outbuf);
  4398. -int reply_lockread(char *inbuf,char *outbuf,int length,int bufsize);
  4399. -int reply_read(char *inbuf,char *outbuf,int length,int bufsize);
  4400. +int reply_lockread(char *inbuf,char *outbuf);
  4401. +int reply_read(char *inbuf,char *outbuf);
  4402.  int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize);
  4403. -int reply_writebraw(char *inbuf,char *outbuf,int length,int bufsize);
  4404. +int reply_writebraw(char *inbuf,char *outbuf);
  4405.  int reply_writeunlock(char *inbuf,char *outbuf);
  4406.  int reply_write(char *inbuf,char *outbuf,int dum1,int dum2);
  4407.  int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize);
  4408. diff -u -r --new-file last-version/source/server.c samba-1.9.15p5/source/server.c
  4409. --- last-version/source/server.c    Thu Nov 23 11:03:36 1995
  4410. +++ samba-1.9.15p5/source/server.c    Sun Dec  3 19:26:05 1995
  4411. @@ -95,6 +95,7 @@
  4412.  
  4413.  #ifdef SMB_PASSWD
  4414.  extern void generate_next_challenge(char *challenge);
  4415. +extern void set_challenge(char *challenge);
  4416.  #endif
  4417.  
  4418.  /* for readability... */
  4419. @@ -1190,31 +1191,45 @@
  4420.    return(False);
  4421.  }
  4422.  
  4423. +/****************************************************************************
  4424. +  C. Hoch 11/22/95
  4425. +  Helper for open_file_shared. 
  4426. +  Truncate a file after checking locking; close file if locked.
  4427. +  **************************************************************************/
  4428. +static void truncate_unless_locked(int fnum, int cnum)
  4429. +{
  4430. +  if (Files[fnum].can_write){
  4431. +    if (is_locked(fnum,cnum,0x3FFFFFFF,0)){
  4432. +      close_file(fnum);   
  4433. +      errno = EACCES;
  4434. +      unix_ERR_class = ERRDOS;
  4435. +      unix_ERR_code = ERRlock;
  4436. +    }
  4437. +    else
  4438. +      ftruncate(Files[fnum].fd,0); 
  4439. +  }
  4440. +}
  4441. +
  4442.  
  4443.  /****************************************************************************
  4444.  open a file with a share mode
  4445.  ****************************************************************************/
  4446. -void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,int mode,int *Access,int *action)
  4447. +void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,
  4448. +              int mode,int *Access,int *action)
  4449.  {
  4450.    int flags=0;
  4451.    int flags2=0;
  4452. -  int old_share=0;
  4453.    int deny_mode = (share_mode>>4)&7;
  4454. -  int open_mode = share_mode&0xF;
  4455. -  int old_deny_mode;
  4456. -  int old_open_mode;
  4457. -  int access_allowed;
  4458.    struct stat sbuf;
  4459.    BOOL file_existed = file_exist(fname,&sbuf);
  4460. -  int share_pid=0;
  4461.    BOOL fcbopen = False;
  4462. +  int share_pid=0;
  4463.  
  4464.    Files[fnum].open = False;
  4465.    Files[fnum].fd = -1;
  4466.  
  4467.    /* this is for OS/2 EAs - try and say we don't support them */
  4468.    if (strstr(fname,".+,;=[].")) {
  4469. -    /* errno = ENOENT; */
  4470.      unix_ERR_class = ERRDOS;
  4471.      unix_ERR_code = ERROR_EAS_NOT_SUPPORTED;
  4472.      return;
  4473. @@ -1230,44 +1245,26 @@
  4474.    if ((ofun & 0x3) == 2)
  4475.      flags2 |= O_TRUNC;
  4476.  
  4477. -#if 0
  4478. -  /* append does not mean the same thing under dos and unix */
  4479. -  if ((ofun & 0x3) == 1)
  4480. -    flags2 |= O_APPEND;
  4481. -#endif
  4482. +  /* note that we ignore the append flag as 
  4483. +     append does not mean the same thing under dos and unix */
  4484.  
  4485. -  {
  4486. -    int open_mode2=open_mode;
  4487. -    switch (open_mode)
  4488. -      {
  4489. -      case 1: 
  4490. -    open_mode2 = 1;
  4491. -    flags = O_WRONLY; 
  4492. -    *Access = 1;
  4493. -    break;
  4494. -      case 0xF: /* XXXX - need to handle FCB open */
  4495. -      case 2: 
  4496. -    if (open_mode == 0xF)
  4497. -      fcbopen = True;
  4498. -    open_mode2 = 2;
  4499. -    flags = O_RDWR; 
  4500. -    *Access = 2;
  4501. -    break;
  4502. -      default:
  4503. -    open_mode2 = 0;
  4504. -    flags = O_RDONLY;
  4505. -    *Access = 0;
  4506. -    break;
  4507. -      }
  4508. -    open_mode = open_mode2;
  4509. -  }
  4510. +  switch (share_mode&0xF)
  4511. +    {
  4512. +    case 1: 
  4513. +      flags = O_WRONLY; 
  4514. +      break;
  4515. +    case 0xF: 
  4516. +      fcbopen = True;
  4517. +      flags = O_RDWR; 
  4518. +      break;
  4519. +    case 2: 
  4520. +      flags = O_RDWR; 
  4521. +      break;
  4522. +    default:
  4523. +      flags = O_RDONLY;
  4524. +      break;
  4525. +    }
  4526.    
  4527. -  if (deny_mode > DENY_NONE && deny_mode!=DENY_FCB) {
  4528. -    DEBUG(2,("Invalid deny mode %d on file %s\n",deny_mode,fname));
  4529. -    errno = EACCES;
  4530. -    return;
  4531. -  }
  4532. -
  4533.    if (flags != O_RDONLY && file_existed && 
  4534.        (!CAN_WRITE(cnum) || IS_DOS_READONLY(dos_mode(cnum,fname,&sbuf)))) {
  4535.      if (!fcbopen) {
  4536. @@ -1275,112 +1272,127 @@
  4537.        return;
  4538.      }
  4539.      flags = O_RDONLY;
  4540. -    *Access = 0;
  4541. -    open_mode = 0;      
  4542.    }
  4543.  
  4544. -  DEBUG(4,("calling open_file with flags=0x%X flags2=0x%X\n",flags,flags2));
  4545. -
  4546. -  open_file(fnum,cnum,fname,flags|flags2,mode);  
  4547. -  if (!Files[fnum].open && flags==O_RDWR && errno!=ENOENT && fcbopen) {
  4548. -    flags = O_RDONLY;
  4549. -    *Access = 0;
  4550. -    open_mode = 0;
  4551. -    open_file(fnum,cnum,fname,flags,mode);
  4552. -    if (Files[fnum].open)
  4553. -      DEBUG(2,("Reduced to O_RDONLY on %s\n",fname));
  4554. +  if (deny_mode > DENY_NONE && deny_mode!=DENY_FCB) {
  4555. +    DEBUG(2,("Invalid deny mode %d on file %s\n",deny_mode,fname));
  4556. +    errno = EINVAL;
  4557. +    return;
  4558.    }
  4559.  
  4560.    if (deny_mode == DENY_FCB) deny_mode = DENY_DOS;
  4561. -  share_mode = (deny_mode<<4) | open_mode;
  4562.  
  4563. -  if (!Files[fnum].open) return;
  4564. +  if (lp_share_modes(SNUM(cnum))) {
  4565. +    int old_share=0;
  4566.  
  4567. -  if (action) {
  4568. -    if (file_existed && !(flags2 & O_TRUNC)) *action = 1;
  4569. -    if (!file_existed) *action = 2;
  4570. -    if (file_existed && (flags2 & O_TRUNC)) *action = 3;
  4571. -  }
  4572. +    if (file_existed)
  4573. +      old_share = get_share_mode(cnum,&sbuf,&share_pid);
  4574.  
  4575. +    if (share_pid) {
  4576. +      /* someone else has a share lock on it, check to see 
  4577. +     if we can too */
  4578. +      int old_open_mode = old_share&0xF;
  4579. +      int old_deny_mode = (old_share>>4)&7;
  4580. +
  4581. +      if (deny_mode > 4 || old_deny_mode > 4 || old_open_mode > 2) {
  4582. +    DEBUG(2,("Invalid share mode (%d,%d,%d) on file %s\n",
  4583. +         deny_mode,old_deny_mode,old_open_mode,fname));
  4584. +    errno = EACCES;
  4585. +    unix_ERR_class = ERRDOS;
  4586. +    unix_ERR_code = ERRbadshare;
  4587. +    return;
  4588. +      }
  4589.  
  4590. -  /* now check the share mode */
  4591. -  if (!lp_share_modes(SNUM(cnum)))
  4592. -    return;
  4593. +      /* C. Hoch 11/21/95 Handle DOS (compatibility) mode on the same machine.
  4594. +       * Any number of read and/or write opens in compatibility mode from the 
  4595. +       * same machine are allowed.
  4596. +       * Also, read opens in compatibility mode from different machines
  4597. +       * are allowed, even if the file is already opened for read in some
  4598. +       * share mode. This is "soft compatibility" mode (Microsoft Knowledge Base,
  4599. +       * WfWG, "How VSHARE386 Manages File Sharing", Q90239), and is handled in
  4600. +       * access_table().
  4601. +       */
  4602. +      if ((deny_mode==DENY_DOS || old_deny_mode==DENY_DOS) && 
  4603. +      share_pid == getpid()) {
  4604. +    if (old_deny_mode != deny_mode) {
  4605. +      DEBUG(2,("Share violation on file %s\n",fname));
  4606. +      errno = EACCES;
  4607. +      unix_ERR_class = ERRDOS;
  4608. +      unix_ERR_code = ERRbadshare;
  4609. +      return;
  4610. +    }
  4611. +      } else {
  4612. +    int access_allowed = access_table(deny_mode,old_deny_mode,old_open_mode);
  4613. +
  4614. +    if ((access_allowed == AFAIL) ||
  4615. +        (access_allowed == AREAD && flags == O_WRONLY) ||
  4616. +        (access_allowed == AWRITE && flags == O_RDONLY)) {
  4617. +      DEBUG(2,("Share violation on file %s\n",fname));
  4618. +      errno = EACCES;
  4619. +      unix_ERR_class = ERRDOS;
  4620. +      unix_ERR_code = ERRbadshare;
  4621. +      return;
  4622. +    }
  4623. +    
  4624. +    if (access_allowed == AREAD)
  4625. +      flags = O_RDONLY;
  4626. +    
  4627. +    if (access_allowed == AWRITE)
  4628. +      flags = O_WRONLY;
  4629. +      }
  4630. +    }
  4631. +  }
  4632.  
  4633. -  Files[fnum].share_mode = share_mode;
  4634. +  if (flags == O_RDONLY) {
  4635. +    /* when opening read only don't allow create and trunc bits */
  4636. +    flags2 &= ~(O_TRUNC | O_CREAT);
  4637. +  }
  4638.  
  4639. -  old_share = get_share_mode(fnum,&share_pid);
  4640.  
  4641. -  Files[fnum].share_pending = True;
  4642. +  DEBUG(4,("calling open_file with flags=0x%X flags2=0x%X\n",flags,flags2));
  4643.  
  4644. -  if (!share_pid) {
  4645. -    share_mode_pending = True;
  4646. -    return;
  4647. +  open_file(fnum,cnum,fname,flags|(flags2&~(O_TRUNC)),mode);
  4648. +  if (!Files[fnum].open && flags==O_RDWR && errno!=ENOENT && fcbopen) {
  4649. +    flags = O_RDONLY;
  4650. +    open_file(fnum,cnum,fname,flags,mode);
  4651.    }
  4652.  
  4653. -  if (old_share == DENY_DOS || deny_mode==DENY_DOS)
  4654. -    if (share_pid == getpid()) {
  4655. -      Files[fnum].share_pending = False;      
  4656. -      return;
  4657. +  if (Files[fnum].open) {
  4658. +    int open_mode;
  4659. +    switch (flags) {
  4660. +    case O_RDONLY:
  4661. +      open_mode = 0;
  4662. +      break;
  4663. +    case O_RDWR:
  4664. +      open_mode = 2;
  4665. +      break;
  4666. +    case O_WRONLY:
  4667. +      open_mode = 1;
  4668. +      break;
  4669.      }
  4670.  
  4671. -  old_open_mode = old_share&0xF;
  4672. -  old_deny_mode = (old_share>>4)&7;
  4673. +    Files[fnum].share_mode = (deny_mode<<4) | open_mode;
  4674. +    Files[fnum].share_pending = True;
  4675.  
  4676. -  if (deny_mode > 4 || old_deny_mode > 4 || old_open_mode > 2) {
  4677. -    DEBUG(2,("Invalid share mode (%d,%d,%d) on file %s\n",
  4678. -         deny_mode,old_deny_mode,old_open_mode,fname));
  4679. -    close_file(cnum);
  4680. -    errno = EACCES;
  4681. -    unix_ERR_class = ERRDOS;
  4682. -    unix_ERR_code = ERRbadshare;
  4683. -    return;
  4684. -  }
  4685. -
  4686. -  access_allowed = access_table(deny_mode,old_deny_mode,old_open_mode);
  4687. -
  4688. -  if ((access_allowed == AFAIL) ||
  4689. -      (access_allowed == AREAD && open_mode == 1) ||
  4690. -      (access_allowed == AWRITE && open_mode == 0)) {
  4691. -    close_file(fnum);
  4692. -    DEBUG(2,("Share violation on file %s\n",fname));
  4693. -    errno = EACCES;
  4694. -    unix_ERR_class = ERRDOS;
  4695. -    unix_ERR_code = ERRbadshare;
  4696. -    return;
  4697. -  }
  4698. +    if (Access) {
  4699. +      (*Access) = open_mode;
  4700. +    }
  4701. +    
  4702. +    if (action) {
  4703. +      if (file_existed && !(flags2 & O_TRUNC)) *action = 1;
  4704. +      if (!file_existed) *action = 2;
  4705. +      if (file_existed && (flags2 & O_TRUNC)) *action = 3;
  4706. +    }
  4707.  
  4708. -  if ((access_allowed == AALL) ||
  4709. -      (access_allowed == AREAD && open_mode == 0) ||
  4710. -      (access_allowed == AWRITE && open_mode == 1)) {
  4711. -    return;
  4712. -  }
  4713. +    if (!share_pid)
  4714. +      share_mode_pending = True;
  4715.  
  4716. -  if (access_allowed == AREAD && open_mode == 2) {
  4717. -    close_file(fnum);
  4718. -    open_mode = 0;
  4719. -    share_mode = (deny_mode<<4) | open_mode;
  4720. -    DEBUG(2,("Share retry on file %s\n",fname));
  4721. -    open_file_shared(fnum,cnum,fname,share_mode,ofun,mode,Access,action);
  4722. -    return;
  4723. +    if (flags2&O_TRUNC) 
  4724. +      truncate_unless_locked(fnum,cnum);
  4725.    }
  4726. +}
  4727.  
  4728. -  if (access_allowed == AWRITE && open_mode == 2) {
  4729. -    close_file(fnum);
  4730. -    open_mode = 1;
  4731. -    share_mode = (deny_mode<<4) | open_mode;
  4732. -    DEBUG(2,("Share retry 2 on file %s\n",fname));
  4733. -    open_file_shared(fnum,cnum,fname,share_mode,ofun,mode,Access,action);
  4734. -    return;
  4735. -  }
  4736.  
  4737. -  /* something weird has happened */
  4738. -  DEBUG(2,("Share error 2 on file %s\n",fname));
  4739. -  close_file(fnum);
  4740. -  errno = EACCES;
  4741. -  unix_ERR_class = ERRDOS;
  4742. -  unix_ERR_code = ERRbadshare;
  4743. -}
  4744.  
  4745.  /*******************************************************************
  4746.  check for files that we should now set our share modes on
  4747. @@ -1389,13 +1401,16 @@
  4748.  {
  4749.    int i;
  4750.    for (i=0;i<MAX_OPEN_FILES;i++)
  4751. -    if(Files[i].open && Files[i].share_pending && 
  4752. -       lp_share_modes(SNUM(Files[i].cnum))) {
  4753. -      int pid=0;
  4754. -      get_share_mode(i,&pid);
  4755. -      if (!pid) {
  4756. -    set_share_mode(i,Files[i].share_mode);
  4757. -    Files[i].share_pending = False;
  4758. +    if(Files[i].open && Files[i].share_pending) {
  4759. +      if (lp_share_modes(SNUM(Files[i].cnum))) {
  4760. +    int pid=0;
  4761. +    get_share_mode_by_fnum(Files[i].cnum,i,&pid);
  4762. +    if (!pid) {
  4763. +      set_share_mode(i,Files[i].share_mode);
  4764. +      Files[i].share_pending = False;
  4765. +    }
  4766. +      } else {
  4767. +    Files[i].share_pending = False;    
  4768.        }
  4769.      }
  4770.  }
  4771. @@ -2228,6 +2243,8 @@
  4772.      }
  4773.      }
  4774.  
  4775. +  reopen_logs();
  4776. +
  4777.    if (test && !lp_file_list_changed())
  4778.      return(True);
  4779.  
  4780. @@ -2241,7 +2258,6 @@
  4781.  
  4782.    reopen_logs();
  4783.  
  4784. -
  4785.    {
  4786.      extern int Client;
  4787.      if (Client != -1) {      
  4788. @@ -2757,6 +2773,9 @@
  4789.  
  4790.    if (lp_security() == SEC_SERVER && server_cryptkey(outbuf)) {
  4791.      DEBUG(3,("using password server validation\n"));
  4792. +#ifdef SMB_PASSWD
  4793. +  if (doencrypt) set_challenge(smb_buf(outbuf));    
  4794. +#endif
  4795.    }
  4796.  
  4797.    CVAL(outbuf,smb_flg) = 0x81; /* Reply, SMBlockread, SMBwritelock supported */
  4798. @@ -2801,6 +2820,9 @@
  4799.  
  4800.    if (lp_security() == SEC_SERVER && server_cryptkey(outbuf)) {
  4801.      DEBUG(3,("using password server validation\n"));
  4802. +#ifdef SMB_PASSWD
  4803. +    if (doencrypt) set_challenge(smb_buf(outbuf));    
  4804. +#endif
  4805.    }
  4806.  
  4807.    CVAL(outbuf,smb_flg) = 0x81; /* Reply, SMBlockread, SMBwritelock supported */
  4808. @@ -2843,6 +2865,9 @@
  4809.  
  4810.    if (lp_security() == SEC_SERVER && server_cryptkey(outbuf)) {
  4811.      DEBUG(3,("using password server validation\n"));
  4812. +#ifdef SMB_PASSWD
  4813. +    if (doencrypt) set_challenge(smb_buf(outbuf));    
  4814. +#endif
  4815.    }
  4816.  
  4817.    if (lp_readraw() && lp_writeraw())
  4818. @@ -2898,11 +2923,10 @@
  4819.    extern fstring remote_arch;
  4820.    int outsize = set_message(outbuf,1,0,True);
  4821.    int Index;
  4822. -  int choice=-1;
  4823. +  int choice= -1;
  4824.    int protocol;
  4825.    char *p;
  4826.    int bcc = SVAL(smb_buf(inbuf),-2);
  4827. -  int maybe_win95 = 0;
  4828.    int arch_known = 0;
  4829.  
  4830.    /* look through the protocol list to determine architecture */
  4831. @@ -2916,18 +2940,16 @@
  4832.            strcpy(remote_arch,"Samba");
  4833.            arch_known = 1;
  4834.          } else if (strcsequal(p,"NT LM 0.12")) {
  4835. -          if (maybe_win95)
  4836. -            strcpy(remote_arch,"Win95");
  4837. -          else
  4838. -            strcpy(remote_arch,"WinNT");
  4839. +      strcpy(remote_arch,"WinNT");
  4840.          } else if (strcsequal(p,"Windows for Workgroups 3.1a")) {
  4841.            strcpy(remote_arch,"WfWg");
  4842. -          maybe_win95 = 1;
  4843.          }
  4844.          Index++;
  4845.        }
  4846.        p += strlen(p) + 2;
  4847.      }
  4848. +
  4849. +  DEBUG(4,("Got remote arch %s\n",remote_arch));
  4850.    
  4851.    /* possibly reload - change of architecture */
  4852.    reload_services(True);      
  4853. @@ -3174,7 +3196,7 @@
  4854.    pstring fname;
  4855.    FILE *f;
  4856.    int snum = SNUM(cnum);
  4857. -  int i,foundi=-1;
  4858. +  int i,foundi= -1;
  4859.    int total_recs;
  4860.  
  4861.    if (max_connections <= 0)
  4862. @@ -3324,6 +3346,10 @@
  4863.    for (i=0;i<MAX_CONNECTIONS;i++)
  4864.      if (Connections[i].open)
  4865.        close_cnum(i,-1);
  4866. +#ifdef DFS_AUTH
  4867. +  if (dcelogin_atmost_once)
  4868. +    dfs_unlogin();
  4869. +#endif
  4870.    if (!reason) {   
  4871.      int oldlevel = DEBUGLEVEL;
  4872.      DEBUGLEVEL = 10;
  4873. @@ -3513,7 +3539,7 @@
  4874.  ****************************************************************************/
  4875.  static int switch_message(int type,char *inbuf,char *outbuf,int size,int bufsize)
  4876.  {
  4877. -  static int pid=-1;
  4878. +  static int pid= -1;
  4879.    int outsize = 0;
  4880.    static int num_smb_messages = 
  4881.      sizeof(smb_messages) / sizeof(struct smb_message_struct);
  4882. @@ -3781,7 +3807,8 @@
  4883.  #if PRIME_NMBD
  4884.    DEBUG(3,("priming nmbd\n"));
  4885.    {
  4886. -    struct in_addr ip = *interpret_addr2("localhost");
  4887. +    struct in_addr ip;
  4888. +    ip = *interpret_addr2("localhost");
  4889.      if (zero_ip(ip)) ip = *interpret_addr2("127.0.0.1");
  4890.      *OutBuffer = 0;
  4891.      send_one_packet(OutBuffer,1,ip,137,SOCK_DGRAM);
  4892. @@ -4006,11 +4033,9 @@
  4893.  
  4894.    TimeInit();
  4895.  
  4896. -  charset_initialise();
  4897. +  setup_logging(argv[0],False);
  4898.  
  4899. -#ifdef SYSLOG
  4900. -  openlog(argv[0], LOG_PID, LOG_DAEMON);
  4901. -#endif
  4902. +  charset_initialise();
  4903.  
  4904.    /* make absolutely sure we run as root - to handle cases whre people
  4905.       are crazy enough to have it setuid */
  4906. diff -u -r --new-file last-version/source/smb.h samba-1.9.15p5/source/smb.h
  4907. --- last-version/source/smb.h    Thu Nov 23 11:03:36 1995
  4908. +++ samba-1.9.15p5/source/smb.h    Sun Dec  3 19:23:44 1995
  4909. @@ -116,6 +116,11 @@
  4910.  #define DENY_NONE 4
  4911.  #define DENY_FCB 7
  4912.  
  4913. +/* share types */
  4914. +#define STYPE_DISKTREE    0    /* Disk drive */
  4915. +#define STYPE_PRINTQ    1    /* Spooler queue */
  4916. +#define STYPE_DEVICE    2    /* Serial device */
  4917. +#define STYPE_IPC    3    /* Interprocess communication (IPC) */
  4918.  
  4919.  /* SMB X/Open error codes for the ERRdos error class */
  4920.  #define ERRbadfunc 1 /* Invalid function (or system call) */
  4921. @@ -491,7 +496,6 @@
  4922.  #define SMBreadX         0x2E   /* read and X */
  4923.  #define SMBwriteX        0x2F   /* write and X */
  4924.  #define SMBsesssetupX    0x73   /* Session Set Up & X (including User Logon) */
  4925. -#define SMBtconX         0x75   /* tree connect and X */
  4926.  #define SMBffirst        0x82   /* find first */
  4927.  #define SMBfunique       0x83   /* find unique */
  4928.  #define SMBfclose        0x84   /* find close */
  4929. @@ -615,7 +619,7 @@
  4930.  char *readdirname(void *p);
  4931.  int dos_chmod(int cnum,char *fname,int mode);
  4932.  int smb_numwords(char *buf);
  4933. -int get_share_mode(int fnum,int *pid);
  4934. +int get_share_mode(int cnum,struct stat *sbuf,int *pid);
  4935.  void del_share_mode(int fnum);
  4936.  BOOL set_share_mode(int fnum,int mode);
  4937.  int DSTDiff(time_t t);
  4938. @@ -713,6 +717,7 @@
  4939.  char *uidtoname(int uid);
  4940.  char *gidtoname(int gid);
  4941.  int get_share_mode_byname(int cnum,char *fname,int *pid);
  4942. +int get_share_mode_by_fnum(int cnum,int fnum,int *pid);
  4943.  BOOL check_file_sharing(int cnum,char *fname);
  4944.  char *StrCpy(char *dest,char *src);
  4945.  int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line);
  4946. @@ -773,6 +778,7 @@
  4947.  char *smb_trans2_param(char *buf);
  4948.  char *smb_trans2_data(char *buf);
  4949.  BOOL strequal(char *,char *);
  4950. +BOOL strnequal(char *,char *,int n);
  4951.  BOOL strcsequal(char *,char *);
  4952.  BOOL mask_match( char *str, char *regexp, int case_sig, BOOL trans2);
  4953.  int dos_mode(int ,char *,struct stat *);
  4954. @@ -835,6 +841,11 @@
  4955.  unsigned long interpret_addr(char *str);
  4956.  void mangle_name_83(char *s);
  4957.  BOOL lp_casesignames(void);
  4958. +void setup_logging(char *pname,BOOL interactive);
  4959. +#ifdef DFS_AUTH
  4960. +void dfs_unlogin(void);
  4961. +extern int dcelogin_atmost_once;
  4962. +#endif
  4963.  #if AJT
  4964.  void ajt_panic(void);
  4965.  #endif
  4966. diff -u -r --new-file last-version/source/smbpasswd.c samba-1.9.15p5/source/smbpasswd.c
  4967. --- last-version/source/smbpasswd.c    Thu Nov 23 11:03:37 1995
  4968. +++ samba-1.9.15p5/source/smbpasswd.c    Sat Dec  2 19:31:49 1995
  4969. @@ -208,242 +208,239 @@
  4970.      exit(1);
  4971.  }
  4972.  
  4973. -int 
  4974. -main(int argc, char **argv)
  4975. +int main(int argc, char **argv)
  4976.  {
  4977. -    int             real_uid;
  4978. -    struct passwd  *pwd;
  4979. -    fstring         old_passwd;
  4980. -    uchar           old_p16[16];
  4981. -    uchar           old_nt_p16[16];
  4982. -    fstring         new_passwd;
  4983. -    uchar           new_p16[16];
  4984. -    uchar           new_nt_p16[16];
  4985. -    char           *p;
  4986. -    struct smb_passwd *smb_pwent;
  4987. -    FILE           *fp;
  4988. -    BOOL            valid_old_pwd = False;
  4989. -    BOOL             got_valid_nt_entry = False;
  4990. -    long            seekpos;
  4991. -    int             pwfd;
  4992. -    char            ascii_p16[66];
  4993. -    char            c;
  4994. -    int             ret, i, err, writelen;
  4995. -    int             lockfd = -1;
  4996. -    char           *pfile = SMB_PASSWD_FILE;
  4997. -    char            readbuf[16 * 1024];
  4998. -
  4999. -    charset_initialise();
  5000. -
  5001. -#ifdef SYSLOG
  5002. -  openlog(argv[0], LOG_PID, LOG_DAEMON);
  5003. -#endif
  5004. -
  5005. +  int             real_uid;
  5006. +  struct passwd  *pwd;
  5007. +  fstring         old_passwd;
  5008. +  uchar           old_p16[16];
  5009. +  uchar           old_nt_p16[16];
  5010. +  fstring         new_passwd;
  5011. +  uchar           new_p16[16];
  5012. +  uchar           new_nt_p16[16];
  5013. +  char           *p;
  5014. +  struct smb_passwd *smb_pwent;
  5015. +  FILE           *fp;
  5016. +  BOOL            valid_old_pwd = False;
  5017. +  BOOL             got_valid_nt_entry = False;
  5018. +  long            seekpos;
  5019. +  int             pwfd;
  5020. +  char            ascii_p16[66];
  5021. +  char            c;
  5022. +  int             ret, i, err, writelen;
  5023. +  int             lockfd = -1;
  5024. +  char           *pfile = SMB_PASSWD_FILE;
  5025. +  char            readbuf[16 * 1024];
  5026. +  
  5027. +  setup_logging(argv[0],True);
  5028. +  
  5029. +  charset_initialise();
  5030. +  
  5031.  #ifndef DEBUG_PASSWORD
  5032. -    /* Check the effective uid */
  5033. -    if (geteuid() != 0) {
  5034. -        fprintf(stderr, "%s: Must be setuid root.\n", argv[0]);
  5035. -        exit(1);
  5036. -    }
  5037. +  /* Check the effective uid */
  5038. +  if (geteuid() != 0) {
  5039. +    fprintf(stderr, "%s: Must be setuid root.\n", argv[0]);
  5040. +    exit(1);
  5041. +  }
  5042.  #endif
  5043. -
  5044. -    /* Get the real uid */
  5045. -    real_uid = getuid();
  5046. -
  5047. -    /* Deal with usage problems */
  5048. -    if (real_uid == 0) {
  5049. -        /* As root we can change anothers password. */
  5050. -        if (argc != 1 && argc != 2)
  5051. -            usage(argv[0]);
  5052. -    } else if (argc != 1)
  5053. -        usage(argv[0]);
  5054. -
  5055. -
  5056. -    if (real_uid == 0 && argc == 2) {
  5057. -        /* If we are root we can change anothers password. */
  5058. -        strncpy(user_name, argv[1], sizeof(user_name) - 1);
  5059. -        user_name[sizeof(user_name) - 1] = '\0';
  5060. -        pwd = getpwnam(user_name);
  5061. -    } else {
  5062. -        pwd = getpwuid(real_uid);
  5063. -    }
  5064. -
  5065. -    if (pwd == 0) {
  5066. -        fprintf(stderr, "%s: Unable to get UNIX password entry for user.\n", argv[0]);
  5067. -        exit(1);
  5068. -    }
  5069. -    /* If we are root we don't ask for the old password. */
  5070. -    old_passwd[0] = '\0';
  5071. -    if (real_uid != 0) {
  5072. -        p = getpass("Old SMB password:");
  5073. -        strncpy(old_passwd, p, sizeof(fstring));
  5074. -        old_passwd[sizeof(fstring)-1] = '\0';
  5075. -    }
  5076. -    new_passwd[0] = '\0';
  5077. -    p = getpass("New SMB password:");
  5078. -    strncpy(new_passwd, p, sizeof(fstring));
  5079. -    new_passwd[sizeof(fstring)-1] = '\0';
  5080. -    p = getpass("Retype new SMB password:");
  5081. -    if (strcmp(p, new_passwd)) {
  5082. -        fprintf(stderr, "%s: Mismatch - password unchanged.\n", argv[0]);
  5083. -        exit(1);
  5084. -    }
  5085. -
  5086. -    if (new_passwd[0] == '\0') {
  5087. -        printf("Password not set\n");
  5088. -        exit(0);
  5089. -    }
  5090. -
  5091. -    /* Calculate the MD4 hash (NT compatible) of the old and new passwords */
  5092. -    memset(old_nt_p16, '\0', 16);
  5093. -    E_md4hash((uchar *)old_passwd, old_nt_p16);
  5094. -
  5095. -    memset(new_nt_p16, '\0', 16);
  5096. -    E_md4hash((uchar *) new_passwd, new_nt_p16);
  5097. -
  5098. -    /* Mangle the passwords into Lanman format */
  5099. -    old_passwd[14] = '\0';
  5100. -    strupper(old_passwd);
  5101. -    new_passwd[14] = '\0';
  5102. -    strupper(new_passwd);
  5103. -
  5104. -    /*
  5105. -     * Calculate the SMB (lanman) hash functions of both old and new passwords.
  5106. -     */
  5107. -
  5108. -    memset(old_p16, '\0', 16);
  5109. -    E_P16((uchar *) old_passwd, old_p16);
  5110. -
  5111. -    memset(new_p16, '\0', 16);
  5112. -    E_P16((uchar *) new_passwd, new_p16);
  5113. -
  5114. -    /*
  5115. -     * Open the smbpaswd file XXXX - we need to parse smb.conf to get the
  5116. -     * filename
  5117. -     */
  5118. -    if ((fp = fopen(pfile, "r+")) == NULL) {
  5119. -        err = errno;
  5120. -        fprintf(stderr, "%s: Failed to open password file %s.\n",
  5121. -            argv[0], pfile);
  5122. -        errno = err;
  5123. -        perror(argv[0]);
  5124. -        exit(err);
  5125. -    }
  5126. -    /* Set read buffer to 16k for effiecient reads */
  5127. -    setvbuf(fp, readbuf, _IOFBF, sizeof(readbuf));
  5128. -
  5129. -    /* make sure it is only rw by the owner */
  5130. -    chmod(pfile, 0600);
  5131. -
  5132. -    /* Lock the smbpasswd file for write. */
  5133. -    if ((lockfd = pw_file_lock(pfile, F_WRLCK, 5)) < 0) {
  5134. -        err = errno;
  5135. -        fprintf(stderr, "%s: Failed to lock password file %s.\n",
  5136. -            argv[0], pfile);
  5137. -        fclose(fp);
  5138. -        errno = err;
  5139. -        perror(argv[0]);
  5140. -        exit(err);
  5141. -    }
  5142. -    /* Get the smb passwd entry for this user */
  5143. -    smb_pwent = _my_get_smbpwnam(fp, pwd->pw_name, &valid_old_pwd, 
  5144. -                                    &got_valid_nt_entry, &seekpos);
  5145. -    if (smb_pwent == NULL) {
  5146. -        fprintf(stderr, "%s: Failed to find entry for user %s in file %s.\n",
  5147. -            argv[0], pwd->pw_name, pfile);
  5148. -        fclose(fp);
  5149. -        pw_file_unlock(lockfd);
  5150. -        exit(1);
  5151. -    }
  5152. -    /* If we are root we don't need to check the old password. */
  5153. -    if (real_uid != 0) {
  5154. -        if ((valid_old_pwd == False) || (smb_pwent->smb_passwd == NULL)) {
  5155. -            fprintf(stderr, "%s: User %s is disabled, plase contact your administrator to enable it.\n", argv[0], pwd->pw_name);
  5156. -            fclose(fp);
  5157. -            pw_file_unlock(lockfd);
  5158. -            exit(1);
  5159. -        }
  5160. -        /* Check the old Lanman password */
  5161. -        if (memcmp(old_p16, smb_pwent->smb_passwd, 16)) {
  5162. -            fprintf(stderr, "%s: Couldn't change password.\n", argv[0]);
  5163. -            fclose(fp);
  5164. -            pw_file_unlock(lockfd);
  5165. -            exit(1);
  5166. -        }
  5167. -        /* Check the NT password if it exists */
  5168. -        if (smb_pwent->smb_nt_passwd != NULL) {
  5169. -            if (memcmp(old_nt_p16, smb_pwent->smb_nt_passwd, 16)) {
  5170. -                fprintf(stderr, "%s: Couldn't change password.\n", argv[0]);
  5171. -                fclose(fp);
  5172. -                pw_file_unlock(lockfd);
  5173. -                exit(1);
  5174. -            }
  5175. -        }
  5176. -    }
  5177. -    /*
  5178. -     * If we get here either we were root or the old password checked out
  5179. -     * ok.
  5180. -     */
  5181. -    /* Create the 32 byte representation of the new p16 */
  5182. -    for (i = 0; i < 16; i++) {
  5183. -        sprintf(&ascii_p16[i * 2], "%02X", (uchar) new_p16[i]);
  5184. -    }
  5185. -    if(got_valid_nt_entry) {
  5186. -        /* Add on the NT md4 hash */
  5187. -        ascii_p16[32] = ':';
  5188. -        for (i = 0; i < 16; i++) {
  5189. -               sprintf(&ascii_p16[(i * 2)+33], "%02X", (uchar) new_nt_p16[i]);
  5190. -        }
  5191. +  
  5192. +  /* Get the real uid */
  5193. +  real_uid = getuid();
  5194. +  
  5195. +  /* Deal with usage problems */
  5196. +  if (real_uid == 0) {
  5197. +    /* As root we can change anothers password. */
  5198. +    if (argc != 1 && argc != 2)
  5199. +      usage(argv[0]);
  5200. +  } else if (argc != 1)
  5201. +    usage(argv[0]);
  5202. +  
  5203. +  
  5204. +  if (real_uid == 0 && argc == 2) {
  5205. +    /* If we are root we can change anothers password. */
  5206. +    strncpy(user_name, argv[1], sizeof(user_name) - 1);
  5207. +    user_name[sizeof(user_name) - 1] = '\0';
  5208. +    pwd = getpwnam(user_name);
  5209. +  } else {
  5210. +    pwd = getpwuid(real_uid);
  5211. +  }
  5212. +  
  5213. +  if (pwd == 0) {
  5214. +    fprintf(stderr, "%s: Unable to get UNIX password entry for user.\n", argv[0]);
  5215. +    exit(1);
  5216. +  }
  5217. +  /* If we are root we don't ask for the old password. */
  5218. +  old_passwd[0] = '\0';
  5219. +  if (real_uid != 0) {
  5220. +    p = getpass("Old SMB password:");
  5221. +    strncpy(old_passwd, p, sizeof(fstring));
  5222. +    old_passwd[sizeof(fstring)-1] = '\0';
  5223. +  }
  5224. +  new_passwd[0] = '\0';
  5225. +  p = getpass("New SMB password:");
  5226. +  strncpy(new_passwd, p, sizeof(fstring));
  5227. +  new_passwd[sizeof(fstring)-1] = '\0';
  5228. +  p = getpass("Retype new SMB password:");
  5229. +  if (strcmp(p, new_passwd)) {
  5230. +    fprintf(stderr, "%s: Mismatch - password unchanged.\n", argv[0]);
  5231. +    exit(1);
  5232. +  }
  5233. +  
  5234. +  if (new_passwd[0] == '\0') {
  5235. +    printf("Password not set\n");
  5236. +    exit(0);
  5237. +  }
  5238. +  
  5239. +  /* Calculate the MD4 hash (NT compatible) of the old and new passwords */
  5240. +  memset(old_nt_p16, '\0', 16);
  5241. +  E_md4hash((uchar *)old_passwd, old_nt_p16);
  5242. +  
  5243. +  memset(new_nt_p16, '\0', 16);
  5244. +  E_md4hash((uchar *) new_passwd, new_nt_p16);
  5245. +  
  5246. +  /* Mangle the passwords into Lanman format */
  5247. +  old_passwd[14] = '\0';
  5248. +  strupper(old_passwd);
  5249. +  new_passwd[14] = '\0';
  5250. +  strupper(new_passwd);
  5251. +  
  5252. +  /*
  5253. +   * Calculate the SMB (lanman) hash functions of both old and new passwords.
  5254. +   */
  5255. +  
  5256. +  memset(old_p16, '\0', 16);
  5257. +  E_P16((uchar *) old_passwd, old_p16);
  5258. +  
  5259. +  memset(new_p16, '\0', 16);
  5260. +  E_P16((uchar *) new_passwd, new_p16);
  5261. +  
  5262. +  /*
  5263. +   * Open the smbpaswd file XXXX - we need to parse smb.conf to get the
  5264. +   * filename
  5265. +   */
  5266. +  if ((fp = fopen(pfile, "r+")) == NULL) {
  5267. +    err = errno;
  5268. +    fprintf(stderr, "%s: Failed to open password file %s.\n",
  5269. +        argv[0], pfile);
  5270. +    errno = err;
  5271. +    perror(argv[0]);
  5272. +    exit(err);
  5273. +  }
  5274. +  /* Set read buffer to 16k for effiecient reads */
  5275. +  setvbuf(fp, readbuf, _IOFBF, sizeof(readbuf));
  5276. +  
  5277. +  /* make sure it is only rw by the owner */
  5278. +  chmod(pfile, 0600);
  5279. +  
  5280. +  /* Lock the smbpasswd file for write. */
  5281. +  if ((lockfd = pw_file_lock(pfile, F_WRLCK, 5)) < 0) {
  5282. +    err = errno;
  5283. +    fprintf(stderr, "%s: Failed to lock password file %s.\n",
  5284. +        argv[0], pfile);
  5285. +    fclose(fp);
  5286. +    errno = err;
  5287. +    perror(argv[0]);
  5288. +    exit(err);
  5289. +  }
  5290. +  /* Get the smb passwd entry for this user */
  5291. +  smb_pwent = _my_get_smbpwnam(fp, pwd->pw_name, &valid_old_pwd, 
  5292. +                   &got_valid_nt_entry, &seekpos);
  5293. +  if (smb_pwent == NULL) {
  5294. +    fprintf(stderr, "%s: Failed to find entry for user %s in file %s.\n",
  5295. +        argv[0], pwd->pw_name, pfile);
  5296. +    fclose(fp);
  5297. +    pw_file_unlock(lockfd);
  5298. +    exit(1);
  5299. +  }
  5300. +  /* If we are root we don't need to check the old password. */
  5301. +  if (real_uid != 0) {
  5302. +    if ((valid_old_pwd == False) || (smb_pwent->smb_passwd == NULL)) {
  5303. +      fprintf(stderr, "%s: User %s is disabled, plase contact your administrator to enable it.\n", argv[0], pwd->pw_name);
  5304. +      fclose(fp);
  5305. +      pw_file_unlock(lockfd);
  5306. +      exit(1);
  5307.      }
  5308. -    /*
  5309. -     * Do an atomic write into the file at the position defined by
  5310. -     * seekpos.
  5311. -     */
  5312. -    pwfd = fileno(fp);
  5313. -    ret = lseek(pwfd, seekpos - 1, SEEK_SET);
  5314. -    if (ret != seekpos - 1) {
  5315. -        err = errno;
  5316. -        fprintf(stderr, "%s: seek fail on file %s.\n",
  5317. -            argv[0], pfile);
  5318. -        fclose(fp);
  5319. -        errno = err;
  5320. -        perror(argv[0]);
  5321. -        pw_file_unlock(lockfd);
  5322. -        exit(1);
  5323. -    }
  5324. -    /* Sanity check - ensure the character is a ':' */
  5325. -    if (read(pwfd, &c, 1) != 1) {
  5326. -        err = errno;
  5327. -        fprintf(stderr, "%s: read fail on file %s.\n",
  5328. -            argv[0], pfile);
  5329. -        fclose(fp);
  5330. -        errno = err;
  5331. -        perror(argv[0]);
  5332. -        pw_file_unlock(lockfd);
  5333. -        exit(1);
  5334. -    }
  5335. -    if (c != ':') {
  5336. -        fprintf(stderr, "%s: sanity check on passwd file %s failed.\n",
  5337. -            argv[0], pfile);
  5338. -        fclose(fp);
  5339. -        pw_file_unlock(lockfd);
  5340. -        exit(1);
  5341. -    }
  5342. -    writelen = (got_valid_nt_entry) ? 65 : 32;
  5343. -    if (write(pwfd, ascii_p16, writelen) != writelen) {
  5344. -        err = errno;
  5345. -        fprintf(stderr, "%s: write fail in file %s.\n",
  5346. -            argv[0], pfile);
  5347. -        fclose(fp);
  5348. -        errno = err;
  5349. -        perror(argv[0]);
  5350. -        pw_file_unlock(lockfd);
  5351. -        exit(err);
  5352. -    }
  5353. +    /* Check the old Lanman password */
  5354. +    if (memcmp(old_p16, smb_pwent->smb_passwd, 16)) {
  5355. +      fprintf(stderr, "%s: Couldn't change password.\n", argv[0]);
  5356. +      fclose(fp);
  5357. +      pw_file_unlock(lockfd);
  5358. +      exit(1);
  5359. +    }
  5360. +    /* Check the NT password if it exists */
  5361. +    if (smb_pwent->smb_nt_passwd != NULL) {
  5362. +      if (memcmp(old_nt_p16, smb_pwent->smb_nt_passwd, 16)) {
  5363. +    fprintf(stderr, "%s: Couldn't change password.\n", argv[0]);
  5364.      fclose(fp);
  5365.      pw_file_unlock(lockfd);
  5366. -    printf("Password changed\n");
  5367. -    return 0;
  5368. +    exit(1);
  5369. +      }
  5370. +    }
  5371. +  }
  5372. +  /*
  5373. +   * If we get here either we were root or the old password checked out
  5374. +   * ok.
  5375. +   */
  5376. +  /* Create the 32 byte representation of the new p16 */
  5377. +  for (i = 0; i < 16; i++) {
  5378. +    sprintf(&ascii_p16[i * 2], "%02X", (uchar) new_p16[i]);
  5379. +  }
  5380. +  if(got_valid_nt_entry) {
  5381. +    /* Add on the NT md4 hash */
  5382. +    ascii_p16[32] = ':';
  5383. +    for (i = 0; i < 16; i++) {
  5384. +      sprintf(&ascii_p16[(i * 2)+33], "%02X", (uchar) new_nt_p16[i]);
  5385. +    }
  5386. +  }
  5387. +  /*
  5388. +   * Do an atomic write into the file at the position defined by
  5389. +   * seekpos.
  5390. +   */
  5391. +  pwfd = fileno(fp);
  5392. +  ret = lseek(pwfd, seekpos - 1, SEEK_SET);
  5393. +  if (ret != seekpos - 1) {
  5394. +    err = errno;
  5395. +    fprintf(stderr, "%s: seek fail on file %s.\n",
  5396. +        argv[0], pfile);
  5397. +    fclose(fp);
  5398. +    errno = err;
  5399. +    perror(argv[0]);
  5400. +    pw_file_unlock(lockfd);
  5401. +    exit(1);
  5402. +  }
  5403. +  /* Sanity check - ensure the character is a ':' */
  5404. +  if (read(pwfd, &c, 1) != 1) {
  5405. +    err = errno;
  5406. +    fprintf(stderr, "%s: read fail on file %s.\n",
  5407. +        argv[0], pfile);
  5408. +    fclose(fp);
  5409. +    errno = err;
  5410. +    perror(argv[0]);
  5411. +    pw_file_unlock(lockfd);
  5412. +    exit(1);
  5413. +  }
  5414. +  if (c != ':') {
  5415. +    fprintf(stderr, "%s: sanity check on passwd file %s failed.\n",
  5416. +        argv[0], pfile);
  5417. +    fclose(fp);
  5418. +    pw_file_unlock(lockfd);
  5419. +    exit(1);
  5420. +  }
  5421. +  writelen = (got_valid_nt_entry) ? 65 : 32;
  5422. +  if (write(pwfd, ascii_p16, writelen) != writelen) {
  5423. +    err = errno;
  5424. +    fprintf(stderr, "%s: write fail in file %s.\n",
  5425. +        argv[0], pfile);
  5426. +    fclose(fp);
  5427. +    errno = err;
  5428. +    perror(argv[0]);
  5429. +    pw_file_unlock(lockfd);
  5430. +    exit(err);
  5431. +  }
  5432. +  fclose(fp);
  5433. +  pw_file_unlock(lockfd);
  5434. +  printf("Password changed\n");
  5435. +  return 0;
  5436.  }
  5437.  
  5438.  #else
  5439. @@ -453,7 +450,7 @@
  5440.  int 
  5441.  main(int argc, char **argv)
  5442.  {
  5443. -    printf("smb password encryption not selected in Makefile\n");
  5444. -    return 0;
  5445. +  printf("smb password encryption not selected in Makefile\n");
  5446. +  return 0;
  5447.  }
  5448.  #endif
  5449. diff -u -r --new-file last-version/source/status.c samba-1.9.15p5/source/status.c
  5450. --- last-version/source/status.c    Thu Nov 23 11:14:41 1995
  5451. +++ samba-1.9.15p5/source/status.c    Sat Dec  2 19:32:46 1995
  5452. @@ -57,6 +57,8 @@
  5453.    BOOL processes_only=False;
  5454.    int last_pid=0;
  5455.  
  5456. +  setup_logging(argv[0],True);
  5457. +
  5458.    charset_initialise();
  5459.  
  5460.    DEBUGLEVEL = 0;
  5461. diff -u -r --new-file last-version/source/testparm.c samba-1.9.15p5/source/testparm.c
  5462. --- last-version/source/testparm.c    Thu Nov 23 11:03:37 1995
  5463. +++ samba-1.9.15p5/source/testparm.c    Sat Dec  2 19:33:58 1995
  5464. @@ -46,11 +46,9 @@
  5465.    pstring configfile;
  5466.    int s;
  5467.  
  5468. +  setup_logging(argv[0],True);
  5469. +  
  5470.    charset_initialise();
  5471. -
  5472. -#ifdef SYSLOG
  5473. -  openlog(argv[0], LOG_PID, LOG_DAEMON);
  5474. -#endif
  5475.  
  5476.    if (argc < 2)
  5477.      strcpy(configfile,CONFIGFILE);
  5478. diff -u -r --new-file last-version/source/testprns.c samba-1.9.15p5/source/testprns.c
  5479. --- last-version/source/testprns.c    Thu Nov 23 11:03:37 1995
  5480. +++ samba-1.9.15p5/source/testprns.c    Sat Dec  2 19:32:09 1995
  5481. @@ -43,11 +43,9 @@
  5482.  {
  5483.     char *pszTemp;
  5484.  
  5485. -   charset_initialise();
  5486. +   setup_logging(argv[0],True);
  5487.  
  5488. -#ifdef SYSLOG
  5489. -  openlog(argv[0], LOG_PID, LOG_DAEMON);
  5490. -#endif
  5491. +   charset_initialise();
  5492.  
  5493.     if (argc < 2 || argc > 3)
  5494.        printf("Usage: testprns printername [printcapfile]\n");
  5495. diff -u -r --new-file last-version/source/trans2.c samba-1.9.15p5/source/trans2.c
  5496. --- last-version/source/trans2.c    Fri Nov 24 14:46:43 1995
  5497. +++ samba-1.9.15p5/source/trans2.c    Sun Dec  3 19:26:38 1995
  5498. @@ -608,6 +608,10 @@
  5499.    /* a special case for 16 bit apps */
  5500.    if (strequal(mask,"????????.???")) strcpy(mask,"*");
  5501.  
  5502. +  /* handle broken clients that send us old 8.3 format */
  5503. +  string_sub(mask,"????????","*");
  5504. +  string_sub(mask,".???",".*");
  5505. +
  5506.    /* Save the wildcard match and attribs we are using on this directory - 
  5507.       needed as lanman2 assumes these are being saved between calls */
  5508.  
  5509. @@ -1445,7 +1449,7 @@
  5510.  {
  5511.    int cnum;
  5512.    int outsize = 0;
  5513. -  int dptr_num=-1;
  5514. +  int dptr_num= -1;
  5515.  
  5516.    cnum = SVAL(inbuf,smb_tid);
  5517.    dptr_num = SVAL(inbuf,smb_vwv0);
  5518. diff -u -r --new-file last-version/source/util.c samba-1.9.15p5/source/util.c
  5519. --- last-version/source/util.c    Thu Nov 23 11:19:04 1995
  5520. +++ samba-1.9.15p5/source/util.c    Sat Dec  2 19:36:08 1995
  5521. @@ -90,9 +90,29 @@
  5522.  
  5523.  static char *filename_dos(char *path,char *buf);
  5524.  
  5525. +static BOOL stdout_logging = False;
  5526.  
  5527. +
  5528. +/*******************************************************************
  5529. +  get ready for syslog stuff
  5530. +  ******************************************************************/
  5531. +void setup_logging(char *pname,BOOL interactive)
  5532. +{
  5533. +#ifdef SYSLOG
  5534. +  if (!interactive) {
  5535. +    char *p = strrchr(pname,'/');
  5536. +    if (p) pname = p+1;
  5537. +    openlog(pname, LOG_PID, LOG_DAEMON);
  5538. +  }
  5539. +#endif
  5540. +  if (interactive) {
  5541. +    stdout_logging = True;
  5542. +    dbf = stdout;
  5543. +  }
  5544. +}
  5545. +
  5546.  /*******************************************************************
  5547. -write an debug message on the debugfile. This is called bug the DEBUG
  5548. +write an debug message on the debugfile. This is called by the DEBUG
  5549.  macro
  5550.  ********************************************************************/
  5551.  #ifdef __STDC__
  5552. @@ -104,7 +124,20 @@
  5553.  {
  5554.    char *format_str;
  5555.  #endif
  5556. -  va_list ap;
  5557. +  va_list ap;  
  5558. +  
  5559. +#ifdef __STDC__
  5560. +  va_start(ap, format_str);
  5561. +#else
  5562. +  va_start(ap);
  5563. +  format_str = va_arg(ap,char *);
  5564. +#endif
  5565. +
  5566. +  if (stdout_logging) {
  5567. +    vfprintf(dbf,format_str,ap);
  5568. +    va_end(ap);
  5569. +    return(0);
  5570. +  }
  5571.  
  5572.  #ifdef SYSLOG
  5573.    if (!lp_syslog_only())
  5574. @@ -119,13 +152,6 @@
  5575.          return(0);
  5576.        }
  5577.    }
  5578. -  
  5579. -#ifdef __STDC__
  5580. -  va_start(ap, format_str);
  5581. -#else
  5582. -  va_start(ap);
  5583. -  format_str = va_arg(ap,char *);
  5584. -#endif
  5585.  
  5586.  #ifdef SYSLOG
  5587.    if (syslog_level < lp_syslog())
  5588. @@ -155,13 +181,15 @@
  5589.      msgbuf[255] = '\0';
  5590.      syslog(priority, "%s", msgbuf);
  5591.    }
  5592. +#endif
  5593.  
  5594. +#ifdef SYSLOG
  5595.    if (!lp_syslog_only())
  5596.  #endif
  5597. -  {
  5598. -    vfprintf(dbf,format_str,ap);
  5599. -    fflush(dbf);
  5600. -  }
  5601. +    {
  5602. +      vfprintf(dbf,format_str,ap);
  5603. +      fflush(dbf);
  5604. +    }
  5605.  
  5606.    va_end(ap);
  5607.    return(0);
  5608. @@ -1102,6 +1130,16 @@
  5609.    if (!s1 || !s2) return(False);
  5610.    
  5611.    return(StrCaseCmp(s1,s2)==0);
  5612. +}
  5613. +
  5614. +/*******************************************************************
  5615. +  compare 2 strings up to and including the nth char.
  5616. +  ******************************************************************/
  5617. +BOOL strnequal(char *s1,char *s2,int n)
  5618. +{
  5619. +  if (!s1 || !s2 || !n) return(False);
  5620. +  
  5621. +  return(StrnCaseCmp(s1,s2,n)==0);
  5622.  }
  5623.  
  5624.  /*******************************************************************
  5625. diff -u -r --new-file last-version/source/version.h samba-1.9.15p5/source/version.h
  5626. --- last-version/source/version.h    Fri Nov 24 23:20:42 1995
  5627. +++ samba-1.9.15p5/source/version.h    Sun Dec  3 22:13:02 1995
  5628. @@ -1 +1 @@
  5629. -#define VERSION "1.9.15p4"
  5630. +#define VERSION "1.9.15p5"
  5631.